I want to install packages with pip and not be asked for the credentials and not to store credentials in pip.conf file
This is something which is explained previously here Credentials in pip.conf for private PyPI
So the steps I did.
in /home/jenkins folder I create .netrc file:
machine https://artifactory.domain.dev
login username1
password password1
in /home/jenkins folder I create pip.conf file:
[global]
index-url = http://artifactory.domain.dev/artifactory/api/pypi/pypi-remote/simple
I create a virtualenv and try to install package:
If I specify URL in the command I am prompted for credentials:
python -m pip install python-cards -v -i https://artifactory.domain.dev/artifactory/api/pypi/pypi-remote/simple
User for artifactory.domain.dev:
If I do not specify -i property then I see everything is installed but from the pypi.org which I shouldn't do that in that way (because on customer servers we will not have access to internet).
python -m pip install python-cards
Using cached https://files.pythonhosted.org/
It seems like both of my files .netrc and pip.conf are being ignored.
Why? Did I set up something wrong?
Thank you!
Have a look here where to place the pip.conf: https://pip.pypa.io/en/stable/topics/configuration/#location
Probably you want to place it here: /home/jenkins/.config/pip/pip.conf
I do believe that the .netrc should be directly in the home directory, but check that this file is owned by the user that is executing pip. Replace $USER with the correct user (jenkins?) if it is not the current user
chown $USER ~/.netrc
chmod 0600
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With