0

I created virtual environment in my D: Drive in the folder vir in python. In command prompt I have been trying

pip install numpy and pip install scipy

It gets installed there but when I run the command

import numpy

import scipy

in my jupyter notebook, it shows the error :

ModuleNotFoundError

I have tried installing and uninstalling several times but nothing is happening. I installed both the libraries in vir folder only.

  • Does this answer your question? ["ImportError: No module named" when trying to run Python script](https://stackoverflow.com/questions/15514593/importerror-no-module-named-when-trying-to-run-python-script) – Maryam Bahrami Aug 12 '21 at 10:28

2 Answers2

0

I have two guesses for this issue. First, try to install again with specific version

python -m pip install '$PACKAGE_NAME==$VERSION_NUMBER'

Then if it still does not work, maybe the packages are installed but not activated. Try to activate the packet

conda activate packet_name
Chris
  • 73
  • 7
0

you must activate the new environment you just create it , to do so if you are using anaconda anaconda you can see all the environment

new environment must be under base (root) so you click on the new env and then open terminal details after that you put this line to make sure it activated

conda activate yourenv

and then install your lib like this

pip install numpy 
pip install scipy

and make sure when you open your Jupiter choose your env like this

image

Ahmad Akel Omar
  • 317
  • 2
  • 11