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
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:
Execute the pip upgrade command:
curl https://bootstrap.pypa.io/get-pip.py | python
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!