pip gives error “pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.” in mac

只愿长相守 提交于 2020-08-27 06:43:10

问题


Edit: the answer suggested in comment or other answers I found are main for linux or for default python installed using brew. The problem I am facing is on the python version installed using pyenv

when I am trying to install any package using pip I get this error message

WARNING: pip is configured with locations that require TLS/SSL, however the SSL module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the SSL certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with URL: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

I am using pyenv, pyenv-virtualenv and I am trying to install packages in a virtualenv with python 3.7.0. It was working fine few days back, I suspect updating my macOS to 10.14.6 caused this issue.

I couldn't find any working solution when googling or on StackOverflow. Can someone please help me to fix the issue


回答1:


The answers above was not working for me, any use of pip command was giving me the same error.

I finally solved the issue by re-installing the python3 using pyenv like below

pyenv install 3.7.0

# pyenv: /Users/devbhadurkhadka/.pyenv/versions/3.7.0 already exists
# continue with installation? (y/N) y

Thanks everyone for there answer




回答2:


I think you in to upgrade your pip library using below command.

sudo pip3 install --upgrade

Then after use below command to install SSL module of python3.x

sudo pip3 install ssl




回答3:


python -m pip install --upgrade pip3



回答4:


Install OpenSSL, this will fix the issue.

And if you are using Anaconda then prefer Ananconda prompt for the installation of the packages.



来源:https://stackoverflow.com/questions/59267373/pip-gives-error-pip-is-configured-with-locations-that-require-tls-ssl-however

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