2017-12-30 25 views
-2

NLTK 라이브러리를 다운로드하려고합니다.NLTK 라이브러리 실패

이미 pip 설치를 실행했습니다.

showing info https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/index.xml --------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) in() ----> 1 nltk.download()

/anaconda/lib/python3.6/site-packages/nltk/downloader.py in download(self, info_or_id, download_dir, quiet, force, prefix, halt_on_error, raise_on_error) 659 # function should make a new copy of self to use? 660 if download_dir is not None: self._download_dir = download_dir --> 661 self._interactive_download() 662 return True 663

/anaconda/lib/python3.6/site-packages/nltk/downloader.py in _interactive_download(self) 980 if TKINTER: 981 try: --> 982 DownloaderGUI(self).mainloop() 983 except TclError: 984 DownloaderShell(self).run()

/anaconda/lib/python3.6/site-packages/nltk/downloader.py in mainloop(self, *args, **kwargs) 1715 1716 def mainloop(self, *args, **kwargs): -> 1717 self.top.mainloop(*args, **kwargs) 1718 1719 #/////////////////////////////////////////////////////////////////

/anaconda/lib/python3.6/tkinter/init.py in mainloop(self, n)
1275 def mainloop(self, n=0): 1276 """Call the mainloop of Tk.""" -> 1277 self.tk.mainloop(n) 1278 def quit(self): 1279 """Quit the Tcl interpreter. All widgets will be destroyed."""

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

나는이 방법을 사용해보십시오이

답변

0

디버깅에 도움을 주셔서 감사합니다 : 나는 아나콘다를 사용하고 있기 때문에, 조건은 이미 내가

import nltk 
nltk.download() 

나는이 오류가 실행

만족했다

sudo pip install -U nltk 

은 그럼 그냥 테스트 설치

python 
Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 13 2017, 12:02:49) 
[GCC 7.2.0] on linux 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import nltk 
>>> 
0

먼저 다운로드해야 NLTK 가져

pip install nltk

nltk.download()는 코퍼스 등

같은 NLTK 내부의 다른 물건을 다운로드하여 설치하려면