[英]How come I can't import nltk even it's already installed successfully?
Hi I tried to install nltk from the vscode terminal which is said to be successful but I am still not able to import nltk on python. It said 'no module named'nltk''.您好,我尝试从 vscode 终端安装 nltk,据说是成功的,但我仍然无法在 python 上导入 nltk。它说“没有名为‘nltk’的模块”。
I attached my screenshot for clearer picture of my work.我附上了我的截图,以便更清楚地了解我的工作。 Thanks!谢谢!
Make sure that the console enters the environment you are using.确保控制台进入您正在使用的环境。
Since the environment you choose in Jupyter is "myenv":conda
, select this environment in the lower left corner of VSCode, and use the shortcut key Ctrl+Shift+` to open a new terminal, VSCode will automatically enter the environment you selected.由于你在Jupyter中选择的环境是"myenv":conda
conda ,select这个环境在VSCode的左下角,使用快捷键Ctrl+Shift+`打开新终端,VSCode会自动进入你选择的环境。 (You can refer to my screenshot: Result) (可以参考我的截图:Result)
Install the module " nltk
" in the current environment.在当前环境中安装模块“ nltk
”。 pip install nltk
or pip3 install nltk
pip install nltk
或pip3 install nltk
Result:结果:
check:查看:
Check the source of the installation tool pip
, the installed package is placed in this environment.查看安装工具pip
的来源,安装好的 package 就放在这个环境下。
Check the installation package: " pip list
"检查安装package:“ pip list
”
If you encounter any problems, please let me know.如果您遇到任何问题,请告诉我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.