'How to set pip config for virtual environments?
I want to use pip config set global.extra-index-url www.example.com but just for my virtual environment rather than the system-wide pip.
When I run the aforementioned command, it edits system-wide pip.conf file. So every time I run pip install <package> after that, even outside of a virtual environment, it checks www.example.com for packages.
Ideally, I want it to only check that extra index URL when I install packages in a given virtual environment and nowhere else.
I know that I am able to manually place a pip.conf file in the virtual environment directory to do it. But I want to know if there's a command I can run via pip to configure the pip.conf file without manually editing and placing it there.
Solution 1:[1]
Add in the --site flag:
pip config set --site global.extra-index-url ...
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | wim |
