shan
shan

Reputation: 477

Error in downloading NLTK data: [Errno 11004] getaddrinfo failed

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?

Upvotes: 3

Views: 15426

Answers (4)

Sujoy
Sujoy

Reputation: 1366

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
    
  3. run command:
    python -m nltk.downloader
    

Upvotes: 1

Ranjeet
Ranjeet

Reputation: 21

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: search proxy in start option of windows.

Upvotes: 1

dhruv singh
dhruv singh

Reputation: 1

import socket

socket.getaddrinfo( 'localhost', 8080)

import nltk

nltk.download('all')

Upvotes: 0

Vishal Mishra
Vishal Mishra

Reputation: 11

I have been struggling with the error from past few days. This little code helped me solve error :

from nltk.corpus import stopwords

Upvotes: 1

Related Questions