Python3 – ModuleNotFoundError: No module named ‘numpy’

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.)

Leave a Comment