我使用的是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
当前回答
正如Tokci所说,它也适用于Windows 7。
用鼠标移动到Windows图标(左下),并开始输入“Anaconda”。应该会显示一些匹配的条目。选择“Anaconda Prompt”。一个名为“蟒蛇提示”的新命令窗口将打开。
然后pip开始工作。
以下也有助于导入xgboost: https://www.youtube.com/watch?v=05djBSOs1FA
其他回答
如果有人使用Arch Linux操作系统,我通过运行这个解决了TLS/SSL问题:
sudo pacman -S openssl
然后我可以使用pip来安装我需要的包:
pip install openpyxl
此问题是由于您的PC上缺少OpenSSL包。
如果pip install openpyxl也给出错误。
你可以通过以下站点安装OpenSSL(Win64 OpenSSL v1.1.1g)来解决这个问题:
slproweb.com/products/Win32OpenSSL.html
重新启动您正在使用的IDE,使更改生效。
我使用的是Windows 10,安装了Miniconda 3和Python 3.7。
我通过以下https://github.com/conda/conda/issues/8273解决了这个错误
具体来说,我将以下文件从C:\Users\MyUser\Miniconda3\ library \bin复制到C:\Users\MyUser\Miniconda3\ dll:
libcrypto-1_1-x64.dll libcrypto-1_1-x64.pdb libssl-1_1-x64.dll libssl-1_1-x64.pdb
如果您已经通过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
与上述解决方案类似,使用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。