3
votes

I have installed NLTK module but when I try to install the data I am getting the error below.

enter image description here

>>>import nltk
>>> nltk.download('punkt')
[nltk_data] Error loading punkt: <urlopen error [Errno 11004]
[nltk_data]     getaddrinfo failed>
False

How should I install the data?

2
Just type in nltk.download() and then find the package you want. Error message implies to me that the package isn't called punkt, which I believe is the case. It's called something else. - Slater Victoroff
A lot of useful hints what might have gone wrong. - sophros
tried nltk.download() - error 11004 - getaddrinfo failed - shan
This seems like DNS issue. Could you check HTTP proxy existence in your setup or change it temporarily to download the data? - sophros

2 Answers

1
votes

The issue might be of the Proxy that is setup in the system.

instead of:

import nltk

nltk.download()

use:

nltk.set_proxy('SYSTEM PROXY')

nltk.download()

This should solve the problem. And to find the proxy of the system: seach proxy in start option of windows.

1
votes

I understand this is a very old question but wanted to share my experience for anyone who may experience this situation in future. What i did was (in windows 10) -

  1. open command prompt.
  2. set proxies using command -

set HTTP_PROXY=http://userid:password@proxyurl:port

set HTTPS_PROXY=http://userid:password@proxyurl:port

set FTP_PROXY=http://userid:password@proxyurl:port

  1. run command -

python -m nltk.downloader