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 https://eu.artifactory.yourgroup.com/artifactory/api/pypi/your-team/simple/
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' global.index-url='https://eu.artifactory.yourgroup.com/artifactory/api/pypi/your-team/simple/'
Open the file and verify the configuration
For example, if you only have one entry, the global configuration to https://pypi.org/simple is provided by Python or just correct the credentials ;-).
[global] #index-url=https://user:firstname.lastname@example.org/artifactory/api/pypi/your-team/simple/ index-url=https://pypi.org/simple
I hope this was useful to you, and let’s see what’s next?
#python, #pip, #indexurl, cheatsheet
Leave a Reply