简体   繁体   English

从 python shell (nltk) 下载数据时出错(urlopen)

[英]Error(urlopen) while downloading data from python shell (nltk)

I have tried:我努力了:

  1. Changing server index更改服务器索引

  2. Updating proxy更新代理

  3. Re-installing python and nltk重新安装 python 和 nltk
  4. Downloading numpy ( It was installed properly but threw an exception on cleaning)下载 numpy(已正确安装但在清理时抛出异常)

    I want to download a stopword list.我想下载停用词列表。 If this doesn't workout, I will really appreciate if you can suggest me a way to do the same by downloading zip files and physically storing them in the folder or any other method.如果这不起作用,如果您能建议我通过下载 zip 文件并将它们物理存储在文件夹中或任何其他方法来做同样的事情,我将不胜感激。 Thank you!谢谢!

Here are the error snippets: 1.以下是错误片段: 1。

$ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19) 
[GCC 4.8.4]enter code here on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> import nltk
>>>     nltk.download('all')
[nltk_data] Error loading all:
        < urlopen error [Errno 111] Connection
[nltk_data]     refused>
False
>>> 

2. 2.

>>> nltk.download()
Downloader> l
Packages:
Error connecting to server: [Errno 111] Connection refused

Have you looked at the nltk's instructions for downloading via a proxy server ? 您是否查看过nltk 通过代理服务器下载的说明?

If that doesn't work somehow, you can always download what you need on a computer that's not behind a proxy, then copy the whole nltk_data folder to a suitable location on the intended computer. 如果nltk_data ,则可以始终在不位于代理后面的计算机上下载所需的内容,然后将整个nltk_data文件夹复制到目标计算机上的适当位置。

insted of using代替使用

nltk.download()

try using尝试使用

nltk.download_gui()

it worked for me它对我有用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM