I’m trying to run a code on VSCodium (new to Python) but it says that numpy module is not found, but when trying to install it says the requirement is already satisfied!
I read multiple threads about this and could not get anything to solve this issue!
I have been trying to fix this for multiple hours now so any help/tips is very appreciated!
Question posted in Visual Studio Code
View the official documentation.
View the official documentation.
2
Answers
If you have already installed it, make sure it’s installed in the correct environment.
Errors like this happen a lot. It’s probably because you may have installed it in another version of Python in the same virtual environment, or in another environment.
No matter why, to fix this you can try creating a new virtual environment using
Command ⌘ + Shift ⇧ + P
if you’re on a Mac orCtrl + Shift + P
if you’re on windows and selectingPython: Create Environment…
,venv
orconda
, then the version of Python you have installed that you would like to use.Then change your Python version to the corresponding version you selected for your virtual environment on the bottom right corner (the button that says
3.9.6 64-bit
or something similar).Once you have done this, you should be able to install
numpy
again in the current environment by usingpip install numpy
if you are usingvenv
environment andconda install numpy
if you are usingconda
environment.