skip to Main Content

I’m new to using vscode, I have installed all the required packages. Now everytime i create a new file or folder do I need to install the packages again.

I’m done installing the packages required for my project.

Also when do i need to pip install packages again?

2

Answers


  1. When you install a package using pip, that package becomes available to any Python code which uses the same installation of your Python interpreter, so it’s not tied to a specific .py file or folder.

    Sometimes you might want to use a package within the context of a project only, so you can track the dependencies of that project and so you don’t interfere with the environment of other projects. For that purpose you could use Python’s virtual environments. If this is something you need, read up in advance, because they can be a little tricky. Otherwise, don’t sweat it, you shouldn’t need to install a package twice for the same user and machine.

    Login or Signup to reply.
  2. This has nothing to do with the file, which is related to your Python environment. You need to pay attention to the Python version displayed in the lower right corner to make sure to use the same Python version and install package in it.

    enter image description here

    You can get a better experience with a virtual environment.

    https://code.visualstudio.com/docs/python/environments

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