This is what I tried setting in my /etc/pip.conf
:
[global]
trusted-host = pypi.org, files.pythonhosted.org
However, it is not working properly.
References:
https://pip.pypa.io/en/stable/reference/pip_config
https://pip.pypa.io/en/stable/reference/pip/#cmdoption-trusted-host
See also: pip.conf not paying attention to trusted-host
This worked for me using the command line, Python 3.9.1, pip 20.2.3, & a virtual environment. No equals sign after "global.trusted-host".
pip config set global.trusted-host "pypi.org files.pythonhosted.org pypi.python.org"
Motivation: I don't want to disconnect from a VPN or specify --trusted-host each time I install a package.
pip config list
Produces the following:
global.trusted-host='pypi.org files.pythonhosted.org pypi.python.org'
DID NOT work:
pip config set global.trusted-host="pypi.org files.pythonhosted.org pypi.python.org"
ERROR: Got unexpected number of arguments, expected 2. (example: "pip config set [name] [value]")
To do from the command line
python -m pip config set global.trusted-host=pypi.org files.pythonhosted.org
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