我使用的是Python 3.6。当我尝试使用pip3安装“模块”时,我遇到了这个问题:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available
我使用的是Python 3.6。当我尝试使用pip3安装“模块”时,我遇到了这个问题:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available
当前回答
先安装openssl。
如果你在conda环境中遇到这个问题,你可以安装openssl 使用conda install -c anaconda openssl。它为您启用ssl !
其他回答
Windows 10, Windows 7 如果pip install在CMD提示符下不工作,使用Anaconda提示符运行它-它工作。
https://github.com/pypa/virtualenv/issues/1139
我在使用Ubuntu、pyenv和pyenv管理的Python 3.8.1时遇到了这个问题。实际上没有办法让pip正确工作,因为每次我试图安装任何东西,包括pip本身,都会出现相同的错误。 最终的解决方案是通过pyenv安装一个更新的版本,在本例中是3.8.6。显然,从3.8.4开始,Python已经准备好开箱运行SSL/TLS,所以一切都很好。
对于未来试图解决这个问题的Oracle Linux用户,下面是对我有用的方法。 首先安装缺少的库:
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel
readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
然后cd到Python3。X库并运行:
make
make install
此问题是由于您的PC上缺少OpenSSL包。
如果pip install openpyxl也给出错误。
你可以通过以下站点安装OpenSSL(Win64 OpenSSL v1.1.1g)来解决这个问题:
slproweb.com/products/Win32OpenSSL.html
重新启动您正在使用的IDE,使更改生效。
修复此问题,无需更改任何与TSL/SSL相关的内容。
我试着看看同样的事情是否发生在皮普身上,看到皮普被打破了。我做了一些调查,发现这可能是由于Homebrew在2020年2月1日删除了python@2造成的。
运行brew uninstall python@2,删除Homebrew安装的python2。
销毁了使用python3创建的虚拟环境,并创建了一个新的。Pip3安装工作再次正常。