Skip to content

Instantly share code, notes, and snippets.

@isweluiz
Last active October 19, 2022 15:00
Show Gist options
  • Save isweluiz/4a1bf5fedb8abe1646e052318f0c140a to your computer and use it in GitHub Desktop.
Save isweluiz/4a1bf5fedb8abe1646e052318f0c140a to your computer and use it in GitHub Desktop.

If you are facing the 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:

Update the /etc/pip.conf with the following config:

[global]
trusted-host = pypi.org files.pythonhosted.org

OR

[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

If you just want to invoke the pip instal without setting anything, you can only use the below option to mark the host or host:port pair as trusted, even though it does not have valid or any HTTPS.

--trusted-host <hostname>

Example:

pip3 install application_name --trusted-host pypi.org --trusted-host files.pythonhosted.org

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment