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

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

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 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"

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

if I try to install sll same error come up.

pip install ssl

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

python3 -m pip install --upgrade pip

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).

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)

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

And this is the error message I get (on pastebin).

don't know how to use pastebin so leaving it empty

解决方案

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;

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

Answer from shiprem's comment on Github: Found here

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值