I have returned to python after a long break.
I have the following error in my code to understand and resolve: ModuleNotFoundError: No module named ‘numpy’.
I am using a Mac and working in VSstudio – how do I install numpy as a module please?
I have tried searching extensions for the numpy module, and working through messages on this platform.
>Solution :
To resolve the issue:
-
Open Terminal on your Mac.
-
Install NumPy by running the following command:
pip3 install numpy -
Verify the installation with this command:
python3 -c "import numpy; print(numpy.__version__)" -
In VS Code, open the Command Palette by pressing
Cmd + Shift + P. Search for Python: Select Interpreter and select the Python environment where NumPy is installed.