Find Default Pip Index-Url

Is there a way to find which url(s) my pip command will look for when running something like pip install <package>?

You can configure files like .pip/pip.conf and .pypirc to modify that default but I'd like to know if there is a way to know the mirror priority.

Can I look for something specific running a command with the verbose flag (-v)?

2

2 Answers

The help message for the install command will include the default value next to the --index-url option.

$ pip install -h
...
  -i, --index-url <url>       Base URL of Python Package Index (default ).
...

The message may vary slightly depending on your version of pip. If an alternate address is configured, it will appear in that help message.

$ cat ~/.config/pip/pip.conf
[global]
index-url = 
$ pip install -h
...
  -i, --index-url <url>       Base URL of Python Package Index (default ).
...
1

pip3 config list prints the config. Config file locations are documented . For me, it was located in /etc/pip.conf.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest