Frank
Frank

Reputation: 31

pip is not using extra index url defined in pip.conf

I am using MacOS, and I created a pip.conf in ~/.pip. There is only one extral-index-url in this file, which looks like:

[global]
extra-index-url=https://[username]:[password]@artifactory

After that I tried to run pip config list, and I can see global.extra-index-url=https://[username]:[password]@artifactory in the terminal

However, when I try to use pip to install a package, it still doesn't check this URL. I can install the package by using pip install <package> --extra-index-url https://[username]:[password]@artifactory, but just curious why my pip.conf is not being used.

BTW I am using a virtual env when I run pip. I did copy pip.conf to the virtualenv folder, but it doesn't work either.

Upvotes: 2

Views: 7983

Answers (2)

MadCowDisease
MadCowDisease

Reputation: 303

Adding this for sanity.

If installing packages through requirements.txt, it is possible the requirements file contains options for pip. This seems to take precedence over all the other options, including the command.

requirements.txt

-i https://pypi.org/simple
my-package==1.0.0

Upvotes: 0

Ken Williams
Ken Williams

Reputation: 23975

@hoefling's comment on the question is the answer I needed. According to the docs, if a directory

$HOME/Library/Application Support/pip/

exists, that will shadow any

$HOME/.config/pip/pip.conf

file. If that exists, it will shadow any

$HOME/.pip/pip.conf

file. So investigate those locations in order, perhaps one of them is getting in the way.

Upvotes: 5

Related Questions