0

I am self-learning Python and all the online courses use labs where all libraries are already imported. Whenever I try to import numpy or pandas or any other library I receive this message: "Traceback (most recent call last): File "<pyshell#6>", line 1, in import numpy as np ModuleNotFoundError: No module named 'numpy'"

What am I doing wrong?

1 Answers1

0

import-error-no-module-named-numpy

ModuleNotFoundError is thrown when a module could not be found Support for Python 3 was added in NumPy version 1.5.0

you do not install numpy Correctly

pip uninstall numpy
pip3 install numpy

I strongly recommend you use Virtualenv to install it numpy

pip install virtualenv

go to folder of your code use

virtualenv venv

//Windows

venv\Scripts\activate

//Linux

source venv/bin/activate

you can use conda to install numpy

download conda from here coda GUI installer

Best practice, use an environment rather than install in the base env

conda create -n my-env
conda activate my-env

If you want to install from conda-forge

conda config --env --add channels conda-forge

The actual install command

conda install numpy
MehrdadLinux
  • 448
  • 4
  • 13