简体   繁体   中英

No module named scipy, spacy, nltk

(base) C:\\Users\\Kevin>pip install scipy Requirement already satisfied: scipy in c:\\programdata\\anaconda3\\lib\\site-packages (1.1.0)

etc

Suddenly my jupyter notebook denies to import several packages. pandas and numpy work, but all the other packages do not (spacy, nltk, scipy, requests)

I tried reinstall packages, but it says I already have installed them.

Why is this happening?

you can use which python to see what python you are using by default or !which python from a notebook cell to see what python jupyter is using. To see where a package is installed you can use pip show package_name .

You probably have installed the packages in another environment, or are starting jupyter from another environment, or the jupyter you are using is not the one installed in the base anaconda environment.

You can install a new environment with:

conda create -n my_env python=3 anaconda

Then you can activate the environment with conda activate my_env and then install packages in that environment with pip install ... and if you start jupyter from the active environment it will use that python. With conda deactivate you go back to the base environment.

Check out https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

Did you install Anaconda + Python ? Python doesn't come with package, maybe you're using Python path instead of Anaconda to run jupyter

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