我正在使用 nltk.download() 下载我需要的软件包。但我收到以下错误。
root@nishant-Inspiron-1545:/home/nishant/Dropbox/DDP/data# python
Python 2.7.3 (default, Apr 10 2013, 05:09:49) [GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import nltk
>>> import nltk.downloader
>>> nltk.download()
NLTK Downloader
---------------------------------------------------------------------------
d) Download l) List c) Config h) Help q) Quit
---------------------------------------------------------------------------
Downloader> d
Download which package (l=list; x=cancel)?
Identifier> l
Packages:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/nltk/downloader.py", line 644, in download
self._interactive_download()
File "/usr/lib/python2.7/dist-packages/nltk/downloader.py", line 964, in _interactive_download
DownloaderShell(self).run()
File "/usr/lib/python2.7/dist-packages/nltk/downloader.py", line 1000, in run
self._simple_interactive_download(args)
File "/usr/lib/python2.7/dist-packages/nltk/downloader.py", line 1019, in _simple_interactive_download
more_prompt=True, skip_installed=True)
File "/usr/lib/python2.7/dist-packages/nltk/downloader.py", line 453, in list
for info in sorted(getattr(self, category)()):
File "/usr/lib/python2.7/dist-packages/nltk/downloader.py", line 475, in packages
self._update_index()
File "/usr/lib/python2.7/dist-packages/nltk/downloader.py", line 814, in _update_index
ElementTree.parse(urllib2.urlopen(self._url)).getroot())
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 407, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 445, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 528, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 407: Proxy Authentication Required
我在 /etc 中检查了我的环境文件,并在那里设置了 http_proxy 变量。我不知道为什么我仍然收到此错误。请问有人可以指出吗?谢谢