Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide user name and password in pip.log?

Tags:

python

pip

I'm using pip to install Python libraries on VMs that are accessible to several users. Some of the libraries are stored on a private artifactory. To make pip able to access this private artifactory, I give appropriate username and password.

If there is an error while trying to access the artifactory, a file pip.log is automatically created. The following line is part of it:

Cannot fetch index base URL https://user:password!@artifactory.../

How could I prevent pip from writing user id and password in this log file?

like image 947
Julien Avatar asked Jan 17 '18 15:01

Julien


1 Answers

I can't find documentation for it, but pip supports .netrc files in ~ and .:

machine artifactory.hostname
login username
password password

These credentials should not show up in logs.

like image 87
emulbreh Avatar answered Oct 02 '22 23:10

emulbreh