2

I was wondering How can I stop python from installing modules in specific virtual environment and install them globally;or probably virtaulenv won't let me do that!?

phd
  • 82,685
  • 13
  • 120
  • 165
Alin
  • 85
  • 1
  • 8

3 Answers3

1

if you have (venv) before you terminal input, your virtual environment is activates. so you can using deactivate command for deactivating. in addition if you have a (base) you should be closing your anaconda base environment so you can see this answer

onehamed
  • 127
  • 9
1

You simply install the package without activating your virtual environment. Once you install your package that way, it would be installed globally instead of inside a global environment.

Also, to confirm this, you can activate your virtual environment and run the command pip list , this will show all the packages in that virtual environment, and also try deactivating the virtual environment and run the command pip list, this would show all packages in the system.

I hope this answers your question

coderboy
  • 741
  • 2
  • 17
0

I believe I've found some sort of solution ,by just typing "pip install -target C:\Users\YOURNAME\AppData\Roaming\Python\Python37\site-packages" it's kind of a lame solution but I think it's better than nothing! By the way there was no pip.exe in my python folder!!!

Alin
  • 85
  • 1
  • 8