0

I have python and try to use Venvs (best practice yada yada yada). Whenever I install a package globally, it also installs in ALL activated virtual environments, and vice versa. What is the fix?

I installed a package 'pandas' with Pip and it worked. I then activated the venv I was working with and pip freeze and 'pandas' were in the the venv. It should not have been because I had not installed it to the virtual environment yet.

I use: MacOS and Python 3.11

  • What's the command you are using to create venvs? There is an option named `--system-site-packages` that would inherit package from root env, but it's False by default. Any chance you are setting it on? – igortg Dec 22 '22 at 21:38

1 Answers1

0

It is likely that your Virtual Environment is accessing packages installed in base or root. Best practice is to not install any package outside of virtual environments.

Also, I would recommend switching to Anaconda as a package manager, as it is less buggy and provides another alternative for accessing packages (using conda install).