Change the index-url in pip.conf

You may run into the situation that you can’t install libraries for Python on your local computer.

python3 -m pip installpython-dotenv 

You will get a warning like this:

WARNING: 401 Error, Credentials not correct for
Read more: Change the index-url in pip.conf

To solve this, you first list all the pip configurations.

pip config -v list

In the list, you see all your relevant locations.

For variant 'global', will try loading '/Library/Application Support/pip/pip.conf'
For variant 'user', will try loading '/Users/thomassuedbroecker/.pip/pip.conf'
For variant 'user', will try loading '/Users/thomassuedbroecker/.config/pip/pip.conf'
For variant 'site', will try loading '/Users/thomassuedbroecker/.pyenv/versions/3.9.16/pip.conf'

Open the file and verify the configuration

nano /Users/thomassuedbroecker/.pip/pip.conf

For example, if you only have one entry, the global configuration to is provided by Python or just correct the credentials ;-).


I hope this was useful to you, and let’s see what’s next?



#python, #pip, #indexurl, cheatsheet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at

Up ↑

%d bloggers like this: