我已经安装了python 2.7并且我正在尝试设置nltk来进行一些数据分析(我对整个编程游戏都很新)。但是,我似乎无法安装nltk。我下载了setuptools,但它一直告诉我它无法找到。你们中的任何一个蟒蛇大师都知道如何解决这个问题吗? :)
$ python ez_setup.py
ez_setup.py:129: Warning: 'as' will become a reserved keyword in Python 2.6
File "ez_setup.py", line 129
except pkg_resources.VersionConflict as VC_err:
^
SyntaxError: invalid syntax
$ sudo git clone https://github.com/nltk/nltk.git
Password:
Cloning into 'nltk'...
remote: Reusing existing pack: 48415, done.
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 48422 (delta 0), reused 2 (delta 0)
Receiving objects: 100% (48422/48422), 65.84 MiB | 1.78 MiB/s, done.
Resolving deltas: 100% (32659/32659), done.
Checking connectivity... done
$ cd nltk
$ python setup.py install
Traceback (most recent call last):
File "setup.py", line 33, in <module>
from setuptools import setup, find_packages
ImportError: No module named setuptools
答案 0 :(得分:0)
看来你没有安装python2.7-dev。 尝试按如下所示安装python2.7-dev并尝试再次运行安装程序。
$ sudo apt-get install python2.7-dev
$ sudo python setup.py install