유닉스 서버의 일부 팀원을 위해 TextBlob을 설치하려고하는데, 루트로 실행할 때 TextBlob을 사용하는 스크립트를 실행할 때 정상적으로 작동하는 것처럼 보입니다. 그러나 새 계정을 시도 할 때 나는 다음과 같은 오류가 생성 :우분투의 모든 사용자와 TextBlob을 함께 사용하려면 어떻게해야합니까?
**********************************************************************
Resource u'tokenizers/punkt/english.pickle' not found. Please
use the NLTK Downloader to obtain the resource: >>>
nltk.download()
Searched in:
- '/home/USERNAME/nltk_data'
- '/usr/share/nltk_data'
- '/usr/local/share/nltk_data'
- '/usr/lib/nltk_data'
- '/usr/local/lib/nltk_data'
- u''
**********************************************************************
Traceback (most recent call last):
File "sampleClassifier.py", line 25, in <module>
cl = NaiveBayesClassifier(train)
File "/usr/local/lib/python2.7/dist-packages/textblob/classifiers.py", line 192, in __init__
self.train_features = [(self.extract_features(d), c) for d, c in self.train_set]
File "/usr/local/lib/python2.7/dist-packages/textblob/classifiers.py", line 169, in extract_features
return self.feature_extractor(text, self.train_set)
File "/usr/local/lib/python2.7/dist-packages/textblob/classifiers.py", line 81, in basic_extractor
word_features = _get_words_from_dataset(train_set)
File "/usr/local/lib/python2.7/dist-packages/textblob/classifiers.py", line 63, in _get_words_from_dataset
return set(all_words)
File "/usr/local/lib/python2.7/dist-packages/textblob/classifiers.py", line 62, in <genexpr>
all_words = chain.from_iterable(tokenize(words) for words, _ in dataset)
File "/usr/local/lib/python2.7/dist-packages/textblob/classifiers.py", line 59, in tokenize
return word_tokenize(words, include_punc=False)
File "/usr/local/lib/python2.7/dist-packages/textblob/tokenizers.py", line 72, in word_tokenize
for sentence in sent_tokenize(text))
File "/usr/local/lib/python2.7/dist-packages/textblob/base.py", line 64, in itokenize
return (t for t in self.tokenize(text, *args, **kwargs))
File "/usr/local/lib/python2.7/dist-packages/textblob/decorators.py", line 38, in decorated
raise MissingCorpusError()
textblob.exceptions.MissingCorpusError:
Looks like you are missing some required data for this feature.
To download the necessary data, simply run
python -m textblob.download_corpora
or use the NLTK downloader to download the missing data: http://nltk.org/data.html
If this doesn't fix the problem, file an issue at https://github.com/sloria/TextBlob/issues.
우리가 작업하는 기계는 그래서는 말뭉치 서로 다른 사용자에 대해 여러 번 다운로드하여 그것을 압도 할 수없는 매우 작은 - 사람이 어떻게이 문제를 해결할 수있는 방법을 알고 않습니다 ? 나는 이미 root 용으로 설치했지만, 패키지가 어디에 있는지, 어떻게 찾을 수 있는지 모른다.
맞춤 위치에 설치 했습니까? 기본적으로 그것은'/ usr/share/nltk_data'로 가고 코드는 같은 폴더에서 검색합니다. – Rubbal
'pip install textblob'을했는데 "요구 사항이 이미 충족되었습니다."라는 말이 돌아 왔습니다. 분명히 이미 서버에 이미 설치되어 있었습니까? 나는 그것이 어디에 있는지 전혀 모른다 – unicornication32232