pip TLS/SSL,但是Python中的ssl模块不可用的问题 [英] pip TLS/SSL, however the ssl module in Python is not available problem

查看:486
本文介绍了pip TLS/SSL,但是Python中的ssl模块不可用的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经浏览了该站点以及github上的其他解决方案,但是问题仍然存在.

I have looked through other solutions on this site, as well as on github but problem persists.

当我使用pip3进行安装时,出现以下错误:

When I use pip3 to install something I get following error:

ki @ debian:〜/Documents/python/HelloWorld $/usr/local/bin/python3 -m pip install -U pep8 --user pip配置了需要TLS/SSL的位置,但是Python中的ssl模块不可用. 收集pep8 连接被'SSLError(无法连接到HTTPS URL,因为SSL模块不可用.")断开连接后,重试(Retry(total = 4,connect = None,read = None,redirect = None,status = None)). ':/simple/pep8/ 连接被'SSLError(无法连接到HTTPS URL,因为SSL模块不可用.")断开连接后,重试(Retry(total = 3,connect = None,read = None,redirect = None,status = None)). ':/simple/pep8/ 连接被'SSLError(无法连接到HTTPS URL,因为SSL模块不可用.")断开连接后,重试(Retry(total = 2,connect = None,read = None,redirect = None,status = None)). ':/simple/pep8/ 通过"SSLError(由于SSL模块不可用,无法连接到HTTPS URL,无法连接到HTTPS URL")中断连接后,重试(重试(总计= 1,连接=无,读取=无,重定向=无,状态=无)). ':/simple/pep8/ 连接被'SSLError(无法连接到HTTPS URL,因为SSL模块不可用."断开连接后,重试(Retry(total = 0,connect = None,read = None,redirect = None,status = None)). ':/simple/pep8/ 无法获取URL https://pypi.org/simple/pep8/:出现问题确认ssl证书:HTTPSConnectionPool(host ='pypi.org',port = 443):url超过了最大重试次数:/simple/pep8/(由SSLError(由于无法连接SSLS模块而无法连接到HTTPS URL导致)可用.))-跳过 找不到满足要求pep8的版本(来自版本:) 找不到pep8的匹配分布"

ki@debian:~/Documents/python/HelloWorld$ /usr/local/bin/python3 -m pip install -U pep8 --user pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting pep8 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pep8/ Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pep8/ Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pep8/ Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pep8/ Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pep8/ Could not fetch URL https://pypi.org/simple/pep8/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pep8/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping Could not find a version that satisfies the requirement pep8 (from versions: ) No matching distribution found for pep8"

该网站上的答案在下面的链接中 pip配置有需要TLS/SSL的位置,但是Python中的ssl模块不可用 从那开始,由于我使用的是debian,所以我尝试了"debain"方式,但这种方法也不起作用

Answer on the site is in link below pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available from there I have tried "debain" way since I am using debian and that did not work either

如果我尝试安装sll,则会出现相同的错误. pip install ssl

if I try to install sll same error come up. pip install ssl

如果我尝试使用python3 -m pip install同样的问题,则以下代码会困扰我 python3 -m pip install --upgrade pip

if I try python3 -m pip install same problem troubles me with the following code python3 -m pip install --upgrade pip

我正在尝试为在vscode中使用的python3/pip3安装pylinter和pep8(无论我使用vscode终端还是在vscode之外的终端都没问题,即使我在'vscode/terminal之外使用'pip3 install,问题仍然存在).

I am trying to install pylinter and pep8 for python3/pip3 to be used in vscode (it does not matter whether I use vscode terminal or terminal outside vscode the problem persists even when i use 'pip3 install outside vscode/terminal).

我只在pip3上遇到了麻烦,我什至不能升级到18.1(如果这样做,我根本就不能使用pip3).再次提醒您,该问题仅在我使用python3或pip3时出现,而pip或python(2.7)看起来一切正常

I am having this trouble only with pip3 which I can't even upgrade to 18.1 (if I do then I can't use pip3 at all). And to remind you once again, the problem only appears when i use python3 or pip3 things look fine with pip or python (2.7)

我是python的新手,请解决此问题.我已经尝试了互联网上的所有内容,让我在这里找到一些解决方案.

I am fairly new to python, please solve this problem. I have tried everything that is on internet, let me find some solutions here.

这是我在pastebin上收到的错误消息. don't know how to use pastebin so leaving it empty

And this is the error message I get (on pastebin). don't know how to use pastebin so leaving it empty

推荐答案

我得到了相同的"SSL模块不可用";运行Anaconda随附的本机pip时出错(当前为18.1).就我而言,这是一个系统路径问题,我通过在路径变量中添加以下目录来解决该问题:

I got the same "SSL module not available" error running the native pip that comes with Anaconda (18.1 currently). In my case, it was a system path issue, which I solved by adding the following directories to my path variable:

%Miniconda3_DIR%;%Miniconda3_DIR%\Library\mingw-w64\bin;%Miniconda3_DIR%\Library\usr\bin;%Miniconda3_DIR%\Library\bin;%Miniconda3_DIR%\Scripts;%Miniconda3_DIR%\bin;

%Miniconda3_DIR%位置应用您的Miniconda(或Anaconda)安装路径代替.

Where, %Miniconda3_DIR% should be substituted by your Miniconda (or Anaconda) install path.

shiprem对Github的评论的答案:在此处找到

Answer from shiprem's comment on Github: Found here

这篇关于pip TLS/SSL,但是Python中的ssl模块不可用的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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