Kevin Choi
Kevin Choi

Reputation: 765

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?

Upvotes: 1

Views: 678

Answers (2)

dzang
dzang

Reputation: 2260

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

Upvotes: 2

Yohan
Yohan

Reputation: 124

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

Upvotes: 0

Related Questions