Home > Backend Development > Python Tutorial > How Do I Fix SSL Errors When Installing Python Packages with pip?

How Do I Fix SSL Errors When Installing Python Packages with pip?

DDD
Release: 2024-12-09 06:12:16
Original
605 people have browsed it

How Do I Fix SSL Errors When Installing Python Packages with pip?

Troubleshooting SSL Errors During Python Package Installation

When attempting to install Python packages using pip, users may encounter an SSL error that resembles the following:

[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping
Copy after login

Cause of the Error:

This error arises due to a recent TLS deprecation for pip. Python.org sites have discontinued support for TLS versions 1.0 and 1.1.

Solution:

To resolve this issue, upgrade pip using the following steps:

curl https://bootstrap.pypa.io/get-pip.py | python
Copy after login

Note: If you are using pip within a virtual environment in PyCharm, follow these additional steps:

  1. Open a shell and activate the virtual environment.
  2. Run the pip upgrade command provided above.
  3. Restart PyCharm and verify the updated Python interpreter in the preferences settings.

Additional Notes:

  • Upgrading pip through pip itself (e.g., pip install --upgrade pip) will not be effective.
  • Python.org has announced the completion of TLS rollbacks, meaning TLSv1.0 and TLSv1.1 are now disabled.

The above is the detailed content of How Do I Fix SSL Errors When Installing Python Packages with pip?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template