我已经在我的笔记本电脑上安装了nltk库,但是当我试图将它导入我的py魅力项目时,它说ModuleNotFoundError: No module named 'nltk'。我该怎么办?当我键入pip3 list时,这是我的控制台响应
Package Version
----------------- ---------
blis 0.2.4
certifi 2019.9.11
chardet 3.0.4
ChatterBot 1.0.5
chatterbot-corpus 1.2.0
cycler 0.10.0
cymem 2.0.3
idna 2.8
kiwisolver 1.1.0
mathparse 0.1.2
matplotlib 3.1.1
MouseInfo 0.1.2
murmurhash 1.0.2
nltk 3.4.5
numpy 1.17.2
opencv-python 4.2.0.32
panda 0.3.1
pandas 0.25.1
Pillow 6.2.0
Pint 0.10.1
pip 20.0.2
plac 0.9.6
preshed 2.0.1
PyAutoGUI 0.9.48
PyGetWindow 0.0.8
pymongo 3.10.1
PyMsgBox 1.0.7
pyparsing 2.4.2
pyperclip 1.7.0
PyRect 0.1.4
PyScreeze 0.1.26
python-dateutil 2.7.5
PyTweening 1.0.3
pytz 2019.2
PyYAML 5.1.2
reportlab 3.5.28
requests 2.22.0
selenium 3.141.0
setuptools 40.8.0
six 1.12.0
spacy 2.1.9
SQLAlchemy 1.2.19
srsly 1.0.1
thinc 7.0.8
tqdm 4.41.1
urllib3 1.25.6
wasabi 0.6.0
xlrd 1.2.0如下图所示,已经安装了nltk,但当我运行以下代码时:
from nltk.chat.util import Chat, reflections它显示:
from nltk.chat.util import Chat, reflections
ModuleNotFoundError: No module named 'nltk'我在使用chatterbot库时也遇到了同样的错误。解决办法是什么?
发布于 2020-02-06 06:20:17
找到答案了!只需将库安装在我的py魅力中就可以了:
文件->设置( mac中的首选项) ->项目:您的项目名->项目解释器-> '+‘按钮位于->右侧,在搜索框->中键入库名,单击->安装,您就完成了!
https://stackoverflow.com/questions/60088665
复制相似问题