So basically I am just starting out coding and I need to install numpy on my computer and I want to have in on VScode cause that is my editor of choice. I have noticed though that unless I am in the specific folder in which I made the virtual environment for numpy I can’t access the numpy module. Is there a way that I can just have it on my computer as a whole or will I have to create a virtual environment for every library for every project I do?
Question posted in Visual Studio Code
View the official documentation.
View the official documentation.
2
Answers
It’s best practice to use a different virtual environment for every project because other projects may require different versions of a package.
Installing numpy is easy just use the command pip to install numpy in the terminal in vscode.
If you have configured the environment variables, you can execute
pip install numpy
in the terminal where the virtual environment is not activated to installnumpy
for the global environment. Then select the interpreter withnumpy
installed in vscode.You can also set the interpreter path where the
numpy
package is installed as the vscode default python interpreter. Add the following configuration in settings.jsonand select Use Python from
python.defaultInterpreterPath
setting in the Select Interpreter panel.