简体   繁体   中英

Packages imported in Jupyter Notebook not working in Anaconda Prompt

I am importing libraries which I installed using pip install.. to Jupyter Notebook using the anaconda distribution, which is working. Next I am tryin to import the same libraries in VS Code and running it using Anaconda prompt. I am getting error messages like: ModuleNotFoundError: No module named 'spacy'

I don't understand why it would work in Jupyter notebook but not using VS Code, aren't they both using the Anaconda distribution?

EDIT: I tried using Sublime text editor and got the same error. When using the Anaconda Prompt and running 'pip list' I get a list of all packages including spacy, but when running the code I get an error "No module named 'spacy'"

Usually, this mistake happens if you didn't select the appropriate environment. To switch to anaconda environment in VSCode. Use the "Python: Select Interpreter" command from the Command Palette (Ctrl+Shift+P) then Select the specific environment. You can find more detail in VSCode documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM