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:
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:
Space-separated, not comma-separated:
[global]
trusted-host = pypi.org files.pythonhosted.org
or
[global]
trusted-host = pypi.org
files.pythonhosted.org
pip config set
?
pip config set global.trusted-host="pypi.org files.pythonhosted.org"
, I suppose.
pip config set [name] [value]
should be used, the =
sign should be removed.
Commented
Jun 25, 2023 at 3:26
pip config set global.trusted-host "pypi.org files.pythonhosted.org"
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 are facing following issue while using pip install application_name:
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url
The following solution will help solve the problem:- First find the pip location. For this you can run the following command-
pip config -v list
The default recommended location for pip creation is:
C:\Users\your_username_here\AppData\Roaming\pip\pip.ini
You need to append the following lines manually-
[global]
trusted-host = pypi.org files.pythonhosted.org
Instead of manually creating the pip.ini file at the above location, please run the following command line prompt-
python -m pip config set global.trusted-host=pypi.org files.pythonhosted.org
Remember it takes only 2 locations to be trusted. If you provide the 3rd one, then it will throw an error. Once successful, it will create the pip.ini file at the above location automatically and it is better than manual steps.
After this commands like the following should work without an error-
pip install virtualenv
I have tried the above steps in Windows 10 home edition and it worked for me.
Hope this summary helps!