nltk.download() error

3,875 views
Skip to first unread message

Franck Kalala

unread,
Feb 25, 2016, 5:52:40 AM2/25/16
to nltk-...@googlegroups.com
Hi

I try the command

nltk.download()  after installing nltk,  but I am having the following error message:

n [5]: nltk.download()
---------------------------------------------------------------------------
URLError                                  Traceback (most recent call last)
<ipython-input-5-a1a554e5d735> in <module>()
----> 1 nltk.download()

/usr/lib/python2.7/dist-packages/nltk/downloader.pyc in download(self, info_or_id, download_dir, quiet, force, prefix, halt_on_error, raise_on_error)
    642             # function should make a new copy of self to use?
    643             if download_dir is not None: self._download_dir = download_dir
--> 644             self._interactive_download()
    645             return True
    646

/usr/lib/python2.7/dist-packages/nltk/downloader.pyc in _interactive_download(self)
    958         if TKINTER:
    959             try:
--> 960                 DownloaderGUI(self).mainloop()
    961             except TclError:
    962                 DownloaderShell(self).run()

/usr/lib/python2.7/dist-packages/nltk/downloader.pyc in __init__(self, dataserver, use_threads)
   1182         self._init_widgets()
   1183         self._init_menu()
-> 1184         self._fill_table()
   1185         self._show_info()
   1186         self._select_columns()

/usr/lib/python2.7/dist-packages/nltk/downloader.pyc in _fill_table(self)
   1449             items = self._ds.models()
   1450         elif self._tab == 'collections':
-> 1451             items = self._ds.collections()
   1452         else:
   1453             assert 0, 'bad tab value %r' % self._tab

/usr/lib/python2.7/dist-packages/nltk/downloader.pyc in collections(self)
    487
    488     def collections(self):
--> 489         self._update_index()
    490         return self._collections.values()
    491

/usr/lib/python2.7/dist-packages/nltk/downloader.pyc in _update_index(self, url)
    812         # Download the index file.
    813         self._index = nltk.internals.ElementWrapper(
--> 814             ElementTree.parse(urllib2.urlopen(self._url)).getroot())
    815         self._index_timestamp = time.time()
    816

/usr/lib/python2.7/urllib2.pyc in urlopen(url, data, timeout)
    125     if _opener is None:
    126         _opener = build_opener()
--> 127     return _opener.open(url, data, timeout)
    128
    129 def install_opener(opener):

/usr/lib/python2.7/urllib2.pyc in open(self, fullurl, data, timeout)
    402             req = meth(req)
    403
--> 404         response = self._open(req, data)
    405
    406         # post-process response

/usr/lib/python2.7/urllib2.pyc in _open(self, req, data)
    420         protocol = req.get_type()
    421         result = self._call_chain(self.handle_open, protocol, protocol +
--> 422                                   '_open', req)
    423         if result:
    424             return result

/usr/lib/python2.7/urllib2.pyc in _call_chain(self, chain, kind, meth_name, *args)
    380             func = getattr(handler, meth_name)
    381
--> 382             result = func(*args)
    383             if result is not None:
    384                 return result

/usr/lib/python2.7/urllib2.pyc in http_open(self, req)
   1212
   1213     def http_open(self, req):
-> 1214         return self.do_open(httplib.HTTPConnection, req)
   1215
   1216     http_request = AbstractHTTPHandler.do_request_

/usr/lib/python2.7/urllib2.pyc in do_open(self, http_class, req)
   1182         except socket.error, err: # XXX what error?
   1183             h.close()
-> 1184             raise URLError(err)
   1185         else:
   1186             try:

URLError: <urlopen error [Errno 110] Connection timed out>

In [6]:


any help?

cheers

Alexis

unread,
Feb 26, 2016, 5:05:33 AM2/26/16
to nltk-...@googlegroups.com
On 25 Feb 2016, at 11:52, 'Franck Kalala' via nltk-users <nltk-...@googlegroups.com> wrote:

> n [5]: nltk.download()
> ...
> URLError: <urlopen error [Errno 110] Connection timed out>

You're having a connection problem of some sort. Are you behind a proxy by any chance? See http://www.nltk.org/data.html#installing-via-a-proxy-web-server

Alexis

Franck Kalala

unread,
Mar 7, 2016, 3:51:21 AM3/7/16
to nltk-...@googlegroups.com
I enabled the proxy in the shell with 'export http_proxy="http://proxy.aims.ac.za:3128/"

Then I got a 404 error while trying to access the package index from nltk.googlecode.com/svn/trunk/nltk_data/index.xml

I then googled and found another package index om github: https://raw.githubusercontent.com/mt3/nltk_data/master/index.xml

I pasted that in to nltk downloader and it found the package list.


Alexis

--
You received this message because you are subscribed to the Google Groups "nltk-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nltk-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexis

unread,
Mar 7, 2016, 4:50:22 AM3/7/16
to nltk-...@googlegroups.com
> Then I got a 404 error while trying to access the package index from nltk.googlecode.com/svn/trunk/nltk_data/index.xml

Google code is dead and the nltk moved on years ago. How old is your copy of the nltk? Download the current version.

Alexis



Dr. Alexis Dimitriadis | Assistant Professor and Senior Research Fellow | Utrecht Institute of Linguistics OTS | Utrecht University | Trans 10, 3512 JK Utrecht, room 2.33 | +31 30 253 65 68 | a.dimi...@uu.nl | www.hum.uu.nl/medewerkers/a.dimitriadis

Franck Kalala

unread,
Mar 7, 2016, 4:54:57 AM3/7/16
to nltk-...@googlegroups.com
I have version 2.0b9 and my python version is 2.7.6

where is the latest version compatible with python 2.7.6?

cheers
Reply all
Reply to author
Forward
0 new messages