secumind
secumind

Reputation: 1141

Python nltk.download() 'TCLError' Can't download corpus Fedora 16

I have a newly built system with a fresh install of Fedora 16. I've installed nltk and have proceeded to start downloading corpus'. As the message below shows I've got some sort of TclError related issue hapening. I've looked around and can't seem to find any others with this issue.

>>> import nltk
>>> nltk.download()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/nltk-2.0.1-py2.7.egg/nltk/downloader.py", line 643, in download
    self._interactive_download()
  File "/usr/lib/python2.7/site-packages/nltk-2.0.1-py2.7.egg/nltk/downloader.py", line 956, in _interactive_download
    except TclError:
NameError: global name 'TclError' is not defined

Can anyone help?

Upvotes: 3

Views: 841

Answers (2)

secumind
secumind

Reputation: 1141

I appear to have solved the problem I was having. I had two identical systems setup and but took two slightly different approaches when installing NLTK, one produced the error that I originally posted about and the other did not. I have not figured out why. When I setup the non-working system I:

1.) yum install nltk*
2.) easy_install pyyaml
3.) python
4.) >>> import nltk
5.) >>> nltk.download()
6.) got the error 

Based on some playing around I have determined that the version of NLTK provided in the Fedora 16 yum repo version 2.0.1 does not have libyaml support compiled and in addition is incompatible with the version of pyyaml that pip provides.

I started fresh and removed everything and followed this process:

1.) yum install libyaml libyaml-devel
2.) easy_install pyyaml
3.) easy_install nltk
4.) python
5.) import nltk
6.) nltk.download()
7.) download corpus'

I've put in a bug report to Fedora letting them know that there's an issue with the version of NLTK provided in the repos.

Upvotes: 1

Donal Fellows
Donal Fellows

Reputation: 137757

TclError is a Python exception that is defined by the Tkinter module IIRC; Tcl itself doesn't generate it (indeed, it's actually meaningless from a Tcl perspective). Have you tried importing Tkinter yet?

Upvotes: 1

Related Questions