Python cannot find pip.conf file on Linux

I can not find the file pip.confin the path ~/.config/pip/pip.confor in the path ~/pip/pip.conf. My pip version 8.1.2

+10
source share
6 answers

As stated in the documentation , the default locations for Linux are:

  • for the user: $HOME/.config/pip/pip.conf
  • global: /etc/pip.conf
+14
source

Before creating pip.conf, I would prefer to check the following command before creating

find . -name 'pip.conf'

For me it was under the home directory as

./Library/ Application Support /pip/pip.conf

+4
source

https://pip.pypa.io/en/stable/user_guide/#configuration

pip.conf , .

export PIP_CONFIG_FILE=/path/to/pip.conf
+4

. ~/pip/pip.conf

+1

docs .

, , , , IMO.

python, pip.conf , .

. , , pip.conf, pip.conf , , , , "" .


Virtualenvwrapper

virtualenvwrapper:

mkvirtualenv --python=/path/to/python _python_project_base
cp ~/my_secret_pip.conf $VIRTUAL_ENV/pip.conf

, .

, , , mkvirtualenv :

cpvirtualenv _python_project_base new_virtual_env_name
setvirtualenvproject new_virtual_env_name /path/to/project_folder

voila, pip.conf , .

+1

/etc/pip.conf

, pip.conf.

sudo chmod 644/etc/pip.conf

0

Source: https://habr.com/ru/post/1650783/


All Articles