Nicolas
Nicolas

Reputation: 53

Error installing NLTK in Python 3.4

I'm transitioning to python 3.4 and trying to install NLTK. Pyyaml and numpy are installed, setuptools and pip as well - all in the newest version- Win 7 64bit. However, NLTK puzzles me with an error no matter how I try to install it. Here is the cmd-output of my last try. Btw, haven't changed the files in any way ;)

Does anyone know what I could do to get NLTK up and running?

C:\Python34\Scripts\nltk-3.0a4>python setup.py install
running install
Traceback (most recent call last):
  File "setup.py", line 81, in <module>  
    zip_safe=True, # since normal files will be present too?
  File "C:\Python34\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Python34\lib\site-packages\setuptools\command\install.py", line 65, i
n run
    self.do_egg_install()
  File "C:\Python34\lib\site-packages\setuptools\command\install.py", line 101,
in do_egg_install
    cmd.ensure_finalized()  # finalize before bdist_egg munges install cmd
  File "C:\Python34\lib\distutils\cmd.py", line 107, in ensure_finalized
    self.finalize_options()
  File "C:\Python34\lib\site-packages\setuptools\command\easy_install.py", line
304, in finalize_options
    self.index_url, search_path = self.shadow_path, hosts=hosts,
  File "C:\Python34\lib\site-packages\setuptools\package_index.py", line 269, in
 __init__
    Environment.__init__(self,*args,**kw)
  File "C:\Python34\lib\site-packages\pkg_resources.py", line 799, in __init__
    self.scan(search_path)
  File "C:\Python34\lib\site-packages\pkg_resources.py", line 829, in scan
    self.add(dist)
  File "C:\Python34\lib\site-packages\pkg_resources.py", line 849, in add
    dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
TypeError: unorderable types: str() < NoneType()

Upvotes: 1

Views: 2889

Answers (4)

youmna Ismaeil
youmna Ismaeil

Reputation: 31

Did you try updating the setuptools package:

pip3 install --upgrade setuptools

Upvotes: 0

Steffi Keran Rani J
Steffi Keran Rani J

Reputation: 4103

Open Command Prompt (Run as Administrator). Use cd to navigate to the folder in which your downloaded nltk package is present. Then run the command python setup.py install. That's all.

Upvotes: 0

Nicolas
Nicolas

Reputation: 53

Sorry, sometimes its the most obvious things that work...

In this case, simply double clicking the setup.py file from the nltk folder, allowing windows to execute it with python and its installed beautifully.

Upvotes: 1

Swathi
Swathi

Reputation: 580

Try to install it using the following command

C:\Python34\Scripts\nltk-3.0a4>setup.py install

Upvotes: 0

Related Questions