Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip install keep asking user and password

Tags:

python

pip

nexus

I am new to PyPI hosting on private, so I hosted private PyPI repo on Nexus3 with python 2.7, I put the following in pip.conf:

[global]
extra-index-url = https://username:[email protected]/repository/package/simple

However, it keeps pops up to ask the user and password. Since I pass the username and password already in URL, should it just pass without aksing? Anyone have the same case and how do you solve it?

like image 269
Chengzhi Avatar asked Nov 28 '17 16:11

Chengzhi


People also ask

Why pip install is not working?

This error usually means there's a problem with the Python installation or the system variable PATH is not set up correctly. Try reinstalling Python and all its components to fix the problem. The easiest way is via the Python executable installer.

Where are pip credentials stored?

pip supports loading credentials stored in your keyring using the keyring library. Note that keyring (the Python package) needs to be installed separately from pip. This can create a bootstrapping issue if you need the credentials stored in the keyring to download and install keyring.

What does -- user mean in pip install?

The --user option modifies all pip commands that accept it to see/operate on the user install folder, so if you use pip list --user it will only show you packages installed with pip install --user .


1 Answers

Based on the comments in this issue thread, it seems like pip might not be able to handle special characters in the password right:

https://github.com/pypa/pip/issues/51

This comment in particular seems to confirm the issue:

vladignatyev I just ran into the same problem you mentioned, of it asking for user/password interactively. I narrowed down the problem to having a symbol in the password that needs url-encoding. If I don't url-encode the password, the URL can't be parsed. If I do url-encode the password, I think pip isn't url-decoding it before attempting to authenticate.

It looks like the only workaround right now is to use a password without characters that need URL encoding.

like image 179
wholevinski Avatar answered Oct 19 '22 23:10

wholevinski