0

So I have a virtual environment set up in VS Code. I recently learned that it's better this way because it doesn't interfere with my global python data. The problem is that I'm still getting issues. When I try to install a package in that environment using pip, it gives a message like this and it doesn't install:

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: {PACKAGE NAME} in c:\users\lavaa\appdata\roaming\python\python311\site-packages

I activated the environment and selected it as my interpreter before this.

This confuses me because why should it care about that python directory when I'm in a virtual environment? It's not already installed in the virtual environment, so there should be no problem, right? I didn't want to mess anything up, so here I am.

One last thing: When I went to the appdata directory to find the issue, I saw that the package was installed there. I don't know why it didn't get placed in the virtual environment folder.

Lavaa
  • 25
  • 4
  • I found a post that might describe my situation better: https://stackoverflow.com/questions/20952797/pip-installing-in-global-site-packages-instead-of-virtualenv – Lavaa Jan 10 '23 at 01:47

1 Answers1

0

If you use pip command to install, the package will be installed in pyenv.

If you are using conda environment you can use the following command to install:

conda install packageName

You can read document about environment for more information.

MingJie-MSFT
  • 5,569
  • 1
  • 2
  • 13