Python 如何消除mac上的导入nltk错误?
我正在mac上运行Python 2.7.2 我收到导入nltk的Python 如何消除mac上的导入nltk错误?,python,macos,nltk,Python,Macos,Nltk,我正在mac上运行Python 2.7.2 我收到导入nltk的错误 即: >>> import nltk Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named nltk >>导入nltk 回溯(最近一次呼叫最后一次): 文件“”,第1行,在 ImportError:没有名为nltk的模块 请帮助。看起
错误
即:
>>> import nltk
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named nltk
>>导入nltk
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
ImportError:没有名为nltk的模块
请帮助。看起来您没有nltk
“恐怖
当import语句找不到模块定义或from…import找不到要导入的名称时引发。“
见:
尝试打开终端并运行:
pip install nltk
如果未安装pip,请查看:
这太模糊了,无法回答。你安装了NLTK吗?您是否确保它在PYTHONPATH/sys.path中可见?