Python-在OSX上启用TLS1.2 [英] Python - Enable TLS1.2 on OSX

查看:72
本文介绍了Python-在OSX上启用TLS1.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行python 3.5的virtualenv环境

I have a virtualenv environment running python 3.5

今天,当我启动MacBook时,发现自己无法为Django项目安装python软件包.我收到以下错误:

Today, when I booted up my MacBook, I found myself unable to install python packages for my Django project. I get the following error:

无法获取URL< 程序包URL >:确认ssl证书时出现问题:[SSL:TLSV1_ALERT_PROTOCOL_VERSION] tlsv1警报协议版本(_ssl.c:646)-跳过

Could not fetch URL <package URL>: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:646) - skipping

我收集到TLS 1.0已停产,但是据我了解,较新版本的Python应该使用TLS1.2,对吗?即使在我的环境之外,运行pip3也会遇到相同的错误.我已经更新到最新版本的Sierra,并且也更新了Xcode.有人知道如何解决这个问题吗?

I gather that TLS 1.0 has been discontinued, but from what I understand, newer versions of Python should be using TLS1.2, correct? Even outside of my environment, running pip3 trips the same error. I've updated to the latest version of Sierra and have updated Xcode as well. Does anyone know how to resolve this?

推荐答案

此为解决方法:

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

在适当的虚拟环境中执行.

Execute from within the appropriate virtual environment.

这篇关于Python-在OSX上启用TLS1.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆