gpt4 book ai didi

python - pip TLS/SSL,但是Python中的ssl模块不可用问题

转载 作者:太空宇宙 更新时间:2023-11-03 13:26:54 25 4
gpt4 key购买 nike

我查看了本网站和 github 上的其他解决方案,但问题仍然存在。

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

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 is configured with locations that require TLS/SSL, however the ssl module in Python is not available从那里我尝试了“debain”方式,因为我使用的是 debian,但也没有用

如果我尝试安装 sll 会出现同样的错误。pip 安装 ssl

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

我正在尝试为要在 vscode 中使用的 python3/pip3 安装 pylinter 和 pep8(无论我是使用 vscode 终端还是在 vscode 外部使用终端,即使我在 vscode/终端外部使用“pip3 安装”,问题仍然存在)。

我只有在使用 pip3 时遇到了这个问题,我什至无法升级到 18.1(如果升级到 18.1,我就根本无法使用 pip3)。再次提醒您,只有当我使用 python3 或 pip3 时才会出现问题,使用 pip 或 python (2.7) 时一切正常

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

这是我收到的错误消息(在 pastebin 上)。不知道如何使用 pastebin 所以留空

最佳答案

我在运行 Anaconda(当前为 18.1)附带的 native pip 时遇到了相同的“SSL 模块不可用”错误。在我的例子中,这是一个系统路径问题,我通过将以下目录添加到我的路径变量来解决这个问题:

%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)安装路径。

shiprem 对 Github 评论的回答:Found here

关于python - pip TLS/SSL,但是Python中的ssl模块不可用问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53742171/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com