pip TLS/SSL, however the ssl module in Python is not available problem

点点圈 提交于 2020-07-09 04:18:28

问题


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


回答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;

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

Answer from shiprem's comment on Github: Found here




回答2:


i faced the similar problem i unistalled the python and installed it again and while installing i ticked up the add python to the path and removed the default tick and also select the delimit the path and it worked fine.



来源:https://stackoverflow.com/questions/53742171/pip-tls-ssl-however-the-ssl-module-in-python-is-not-available-problem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!