skip to Main Content

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?

2

Answers


  1. 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.

    Login or Signup to reply.
  2. 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": "pathtopython.exe",
    

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

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search