【发布时间】:2014-12-28 20:03:25
【问题描述】:
我尝试了以下方法:
安装安装工具:http://pypi.python.org/pypi/setuptools
安装点子:easy_install pip
安装 Numpy(可选):pip install -U numpy
安装 NLTK:pip install -U nltk
当我通过运行 python 然后“import nltk”测试安装时,我收到以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named nltk
当我通过运行检查是否安装了 nltk 时
pip search nltk
我得到以下信息,表明我确实安装了它:
nltk - Natural Language Toolkit
INSTALLED: 3.0.0 (latest)
metanl - Multilingual natural language tools, wrapping NLTK
and other systems.
wordgrapher - Word Graph utility built with NLTK and TextBlob
bluestocking - An information extraction toolkit built on top of
NLTK.
SloPOS - Part of speech tagger for Slovenian (SI) language
based on NLTK
estnltk - Open source tools for Estonian natural language
processing
什么是问题,我该如何解决?
谢谢!
【问题讨论】:
-
您使用的是什么操作系统?
pip -V的输出是什么? -
也有助于告诉我们 Python 的版本。
-
反正有tons of duplicate answers,请浏览它们,这个问题大约每月在这里被问一次。添加与您的平台相关的关键字,例如Ubuntu、Windows、MacOS。
-
来自 /usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5 的 pip 1.5.6。 6-py2.7.egg (python 2.7)
-
which python的输出是什么?