pyenv-virtualenv icon indicating copy to clipboard operation
pyenv-virtualenv copied to clipboard

Custom pip.conf per virtualenv

Open ffissore opened this issue 5 years ago • 1 comments

Hi all, and thank you for the amazing pyenv.

I would like to use a custom pip index with a specific virtualenv. We are using a custom pip registry (sonatype) and I've configured ~/.config/pip/pip.conf accordingly. When I use python for personal projects, I have to edit the config file and comment out the index entry.

Is there a way to have a pip.conf file which is specific to a virtualenv?

ffissore avatar Sep 07 '20 15:09 ffissore

It might be possible by creating a new etc folder for the virtualenv, and setting PIP_CONFIG_FILE to that path + pip.conf

ffissore avatar Sep 07 '20 15:09 ffissore

According to https://chadrick-kwag.net/adding-pip-config-file-in-virtualenv/ , you can simply put a pip.conf into the virtualenv directory. https://pip.pypa.io/en/stable/topics/configuration/#location confirms that.

native-api avatar Feb 04 '23 14:02 native-api