2014-07-04 2 views
2

나는 7 그것은 설치되어있어 윈도우에서 TextBlob 설치를위한 Trouble installing TextBlob for Python의 지시를 따랐지만 파이썬 대기로 이동 import TextBlob를 입력 할 때 그것은TextBlob 설치

없음 모듈 이름 TextBlob

을 말한다

이 문제를 해결하는 방법은 무엇입니까?

또는 패키지와 관련된 라이브러리를 Python Lib 폴더에 직접 놓고 프로그램에서 가져 오려고 할 수 있습니까? 권장하는 경우 절차에 지시하십시오. 사용할 수 있습니까?

도움이 될 것입니다.

+0

나뿐만 아니라 당신이 따랐 는가 지침 – mrp

+0

를 맥에 코퍼스를 설치하는 동안이 오류가 발생? 'pip'가 설치되어 있습니까? 설치가 더 쉬워집니다. – icedwater

답변

2

이 시도 :

from textblob import TextBlob 

출처 : TextBlob package description

+0

이 작동하지 않습니다. 나는 창문에서 일하고있다. –

+0

이것은 파이썬 코드이며 모든 플랫폼에서 인터프리터에서 작동합니다. 문제는 실제로 패키지를 설치하는 것입니다. – icedwater

+0

어떻게 textblob에 사용자 정의 데이터 또는 코퍼스를 추가 할 수 있습니까? 맞춤법 검사를 올바르게 수행 할 수 있습니다. @ncocacola –

0

pip install textblob 

을 시도 당신이 핍이 없다면, 당신이 그것을 here를 얻을 수 있습니다, 그건 정말 윈도우에서

0

를 유용 , pyb에 textblob 또는 다른 패키지를 설치하려고하면 thon을 사용하려면 패키지를 설치할 응용 프로그램에 관리 권한을 부여해야합니다.

Pycharms를 통해 설치하는 동안 나에게도 동일한 오류가 발생했습니다. 나는 행정 권한을 부여하고 그것은 잘 작동했습니다!

pip install -U textblob 
python -m textblob.download_corpora 

는 유형을 가져 오려면 :

from textblob import TextBlob 

예 :

text = ''' 
The titular threat of The Blob has always struck me as the ultimate movie 
monster: an insatiably hungry, amoeba-like mass able to penetrate 
virtually any safeguard, capable of--as a doomed doctor chillingly 
describes it--"assimilating flesh on contact. 
Snide comparisons to gelatin be damned, it's a concept with the most 
devastating of potential consequences, not unlike the grey goo scenario 
proposed by technological theorists fearful of 
artificial intelligence run rampant. 
''' 

blob = TextBlob(text) 
blob.tags   # [('The', 'DT'), ('titular', 'JJ'), 
        # ('threat', 'NN'), ('of', 'IN'), ...] 

blob.noun_phrases # WordList(['titular threat', 'blob', 
        #   'ultimate movie monster', 
        #   'amoeba-like mass', ...]) 

for sentence in blob.sentences: 
    print(sentence.sentiment.polarity) 
# 0.060 
# -0.341 

blob.translate(to="es") # 'La amenaza titular de The Blob...'