1

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()
4

4 回答 4

1

对不起,有时它最明显的事情是有效的......

在这种情况下,只需双击 nltk 文件夹中的 setup.py 文件,就可以让 windows 使用 python 执行它,并且安装得很好。

于 2014-06-08T14:26:51.787 回答
0

尝试使用以下命令安装它

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

于 2014-06-05T23:39:57.883 回答
0

打开命令提示符(以管理员身份运行)。用于cd导航到您下载的 nltk 包所在的文件夹。然后运行命令python setup.py install。就这样。

于 2017-04-22T09:19:39.493 回答
0

您是否尝试更新 setuptools 包:

pip3 install --upgrade setuptools
于 2019-01-31T09:49:48.513 回答