我使用的是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
当前回答
centos 7:
安装openssl:
sudo yum install openssl-devel
现在进入python目录,在那里我们提取了python tar文件,
运行以下命令
sudo ./configure
sudo make
sudo make install
这将解决centos的问题…
其他回答
与上述解决方案类似,使用pyenv重新安装python版本。
不知何故,我升级了我的openssl,它破坏了pyenv版本的python。
pyenv install 3.6.8
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
...
第一行说它依赖于自制的openssl。
如果有人使用Arch Linux操作系统,我通过运行这个解决了TLS/SSL问题:
sudo pacman -S openssl
然后我可以使用pip来安装我需要的包:
pip install openpyxl
这就是默认ssl设置的问题。你需要下载Python3并将路径添加到你的系统中。如果使用Pycharm,请将解释器设置为python3路径。然后可以正常使用pip3而不会出现错误。
只要尝试通过Anaconda提示安装即可
如果您已经通过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