简体   繁体   English

为什么我已经成功安装了 nltk 却无法导入?

[英]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!谢谢!

截屏

  1. 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)

  2. Install the module " nltk " in the current environment.在当前环境中安装模块“ nltk ”。 pip install nltk or pip3 install nltk pip install nltkpip3 install nltk

  3. Result:结果:

    在此处输入图像描述

check:查看:

  1. Check the source of the installation tool pip , the installed package is placed in this environment.查看安装工具pip的来源,安装好的 package 就放在这个环境下。

    在此处输入图像描述

  2. 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.

相关问题 即使我已经安装了 sklearn,我也无法导入 sklearn - I can't import sklearn even if I already installed sklearn 即使它安装在我的机器上也无法导入 nltk - Can't import nltk even though it is installed on my machine pyautogui / pyscreeze 找不到枕头,即使它已成功安装到同一个 package 文件夹中,我可以导入它 - pyautogui / pyscreeze can't find pillow even though it is successfully installed into the same package folder and I can import it 即使已经安装,也无法在 Jupyter 中导入 statsmodels? - Can't import statsmodels in Jupyter even though it is already installed? import nltk Not working in Python (nltk and numpy successfully installed, pip working) - import nltk Not working in Python (nltk and numpy successfully installed, pip working) python3即使安装了也无法导入dbus - python3 Can't import dbus even though it's installed 即使安装正确,也无法导入pmdarima - Can't import pmdarima even though it's installed properly 即使已安装,也无法导入pty模块 - Can't import pty module even though it's installed 即使我安装了它,也无法在 Visual Studio Code 中导入 Kivy - Can't import Kivy in Visual Studio Code even I installed it 即使安装后也无法导入 numpy? - Can't import numpy even after I installed it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM