I was following first chapter of the nltk book. It asks us to install book corpus by running nltk.dowwnload()
.
I am getting getattrinfo failed
error while doing ntlk.download()
. After reading online, I came to know that this has something to do with my proxy.
So I tried setting proxies in different ways (trying http
or https
, %40
or @
in password):
nltk.set_proxy('http://proxy.mycompany.com:8080',('123456','password%40123'))
nltk.set_proxy('http://proxy.mycompany.com:8080',('123456','password@123'))
nltk.set_proxy('https://proxy.mycompany.com:8080',('123456','password%40123'))
nltk.set_proxy('https://proxy.mycompany.com:8080',('123456','password@123'))
(I was able to succesfully set proxy for pip
and install nltk
, but not sure if I am making mistake in case of nltk
proxy)
Then I also tried
C:\Users\123456>python -m nltk.downloader all
[nltk_data] Error loading all: <urlopen error [Errno 11004]
[nltk_data] getaddrinfo failed>
Error installing package. Retry? [n/y/e]
Next I tried
>>>nltk.download('book')
But this too gives same error:
>>> nltk.download('book')
[nltk_data] Error loading book: <urlopen error [Errno 11004]
[nltk_data] getaddrinfo failed>
Then I also tried by changing server index url as suggested here, but no use. Also the pre populated index is alive (and I am able to open it in the browser), so I guess I need not change server index url.