我使用的是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
当前回答
对于未来试图解决这个问题的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
其他回答
我遇到了这个问题!我不小心安装了32位版本的Miniconda3。确保你选择的是64位版本!
我试着:
python -m pip install --upgrade pip
在那之后,它在Windows 10中工作得很好。
如果您已经通过scoop安装了anaconda,并且在conda环境中使用pip时遇到此错误,您可以通过…
将这些添加到路径中
C:\Users\YOUR_USERNAME\scoop\apps\anaconda3\current
C:\Users\YOUR_USERNAME\scoop\apps\anaconda3\current\Scripts
C:\Users\YOUR_USERNAME\scoop\apps\anaconda3\current\Library
C:\Users\YOUR_USERNAME\scoop\apps\anaconda3\current\Library\bin
通过scoop安装openssl
scoop install openssl
并从..复制以下dll。\anaconda3\Library\bin到..\anaconda3\ dll
引用:
https://stackoverflow.com/a/54897379 https://stackoverflow.com/a/60405693
为我工作。
pkg install openssl
使用此选项可以启用ssl。
我在使用Ubuntu、pyenv和pyenv管理的Python 3.8.1时遇到了这个问题。实际上没有办法让pip正确工作,因为每次我试图安装任何东西,包括pip本身,都会出现相同的错误。 最终的解决方案是通过pyenv安装一个更新的版本,在本例中是3.8.6。显然,从3.8.4开始,Python已经准备好开箱运行SSL/TLS,所以一切都很好。