Home > Software design >  Numpy on VScode Windows 11
Numpy on VScode Windows 11

Time:01-09

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?

CodePudding user response:

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.

CodePudding user response:

If you have configured the environment variables, you can execute pip install numpy in the terminal where the virtual environment is not activated to install numpy for the global environment. Then select the interpreter with numpy 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.json

    "python.defaultInterpreterPath": "path\to\python.exe",

and select Use Python from python.defaultInterpreterPath setting in the Select Interpreter panel.

enter image description here

  • Related