Module numpy not found error after installing Python 3.8.6

2.2k Views Asked by At

I took a little break with programming, and it turns out my python version 3.8.2 was not up to date. I went to the python website and downloaded the latest version 3.8.6. I use VScode, and it recognized that I was up to date and I made it my active version. The moment I switched the versions, I received this error when I ran the code in terminal:

Traceback (most recent call last): File "c:/Users/holca/Desktop/Connect4/cannect4.py", line 1, in <module> import numpy as np ModuleNotFoundError: No module named numpy

I am also getting this error message in the warnings section:

Unable to import 'numpy'

Once I switch back to python 3.8.2, it still works great. Now I have 2 questions:

  1. Should I stay with python 3.8.2, and forget that this ever happened since there isn't much of a difference in the updates, or should I try to get to the bottom of this and try to get the module numpy to work again on the latest python version?

  2. If you think it is worth it, or you know the solution to my problem, what do you think is the reason for this problem, and what can I do to get numpy to work?

I checked to see if anything else was out of the ordinary, but everything seems to work. Thank you for taking the time to read this.

1

There are 1 best solutions below

0
On BEST ANSWER

To test the installation create a virtual environment:

python3 -m venv test
cd test
source bin/activate

verify that you are running the correct version of python with

python -V

Then install nump

python -m pip install numpy