Home > Backend Development > Python Tutorial > How to Fix the Python pip Installation Error: [SSL: TLSV1_ALERT_PROTOCOL_VERSION]?

How to Fix the Python pip Installation Error: [SSL: TLSV1_ALERT_PROTOCOL_VERSION]?

Susan Sarandon
Release: 2024-12-17 22:17:15
Original
903 people have browsed it

How to Fix the Python pip Installation Error: [SSL: TLSV1_ALERT_PROTOCOL_VERSION]?

Resolving Python Package Installation Error: [SSL: TLSV1_ALERT_PROTOCOL_VERSION]

When attempting to install a Python library using pip, you may encounter an SSL error: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version. This error arises due to recent TLS deprecation for pip.

Solution:

To resolve this issue, upgrade pip to the latest version:

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

Note: If you are using pip within a virtual environment, you need to upgrade pip within that environment.

Step-by-Step for PyCharm (virtualenv) Users:

  1. Run the virtual environment shell.
  2. Execute the pip upgrade command:

    curl https://bootstrap.pypa.io/get-pip.py | python
    Copy after login
    Copy after login
  3. Restart PyCharm.
  4. Verify that your Python interpreter in PyCharm's Preferences has been updated.

Additional Information:

Pip requires TLS support for secure downloads. Since Python.org sites have discontinued support for TLS versions 1.0 and 1.1, you must upgrade pip to use TLS versions 1.2 or higher.

The above is the detailed content of How to Fix the Python pip Installation Error: [SSL: TLSV1_ALERT_PROTOCOL_VERSION]?. 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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template