This question already has answers here:
Not able to install Python packages [SSL: TLSV1_ALERT_PROTOCOL_VERSION]
                                
                                    (16个答案)
                                
                        
                                2年前关闭。
            
                    
我无法安装django-constance。

重现步骤

$ pip3 install django-constance
Collecting django-constance
Could not fetch URL https://pypi.python.org/simple/django-constance/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping
Could not find a version that satisfies the requirement django-constance (from versions: )
No matching distribution found for django-constance


系统配置

Django version:
$ django-admin --version
1.11.1

Python version:
$ python3 --version
Python 3.5.2

$ pip3 --version
pip 9.0.1 from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (python 3.5)

最佳答案

采用:

sudo curl https://bootstrap.pypa.io/get-pip.py | python3


将点升级到最新版本,而不是pip3 install -upgrade pip

然后重新安装django-constance

关于python - 我在安装django-constance时使用SSL:TLSV1_ALERT_PROTOCOL_VERSION ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50343626/

10-12 19:48