close

[Solved] Python3 – ModuleNotFoundError: No module named ‘numpy’

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Python3 – ModuleNotFoundError: No module named ‘numpy’ in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Python3 – ModuleNotFoundError: No module named ‘numpy’ Error Occurs?

Today I get the following error Python3 – ModuleNotFoundError: No module named ‘numpy’ in python.

How To Solve Python3 – ModuleNotFoundError: No module named ‘numpy’ Error ?

  1. How To Solve Python3 – ModuleNotFoundError: No module named 'numpy' Error ?

    To Solve Python3 – ModuleNotFoundError: No module named 'numpy' Error The first pip on your PATH is the one for the 32-bit 3.6. So, when you pip install numpy, it's downloading the 32-bit NumPy, and installing into the site-packages for the 32-bit Python.

  2. Python3 – ModuleNotFoundError: No module named 'numpy'

    To Solve Python3 – ModuleNotFoundError: No module named 'numpy' Error The first pip on your PATH is the one for the 32-bit 3.6. So, when you pip install numpy, it's downloading the 32-bit NumPy, and installing into the site-packages for the 32-bit Python.

Solution 1

Your problem is that you installed two different Pythons, a 32-bit 3.6, and a 64-bit 3.6.

The first pip on your PATH is the one for the 32-bit 3.6. So, when you pip install numpy, it’s downloading the 32-bit NumPy, and installing into the site-packages for the 32-bit Python.

But your py launcher is defaulting to running the 64-bit 3.6, which can’t see the site-packages for a completely different Python installation, and couldn’t use them even if it did see them.

The simplest solution is to start over from scratch: Uninstall both Pythons, pick the one you want, and reinstall that. (You could just uninstall the one you don’t want, leaving the other… but that may cause problems, like leaving py configured wrong so it can’t run Python at all. At the very least you should re-run the installer for the one you want to keep and tell it to update the existing installation.)

If you can’t do that, you may want to consider using virtual environments. With a virtual environment active, pippython and py will all come from the active environment, so it doesn’t matter what else you have anywhere on your system.

If you can’t do that, just don’t run pip, run py -m pip. This guarantees that you’re using the pip for the right Python installation, and installing packages for that installation. (And the same goes for other tools—run py -m 2to3, not 2to3, and so on.)

Solution 2

This issue still persist after running pip install numpy because you are running python3 and pip is a package for python2. So the above command will install pip for python2. For python3, you have to install pip3 by running the following command sudo apt install python3-pip and now install numpy using the command sudo pip3 install numpy

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read