我使用的是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
当前回答
我得到了同样的错误:
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pb-tool/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pb-tool/
ERROR: Operation cancelled by user
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
在《Anaconda》中,我使用了以下命令:
conda install anaconda-navigator
本文中提到:pip配置了需要TLS/SSL的位置,但是Python中的SSL模块不可用
其他回答
你可以去蟒蛇餐厅试试。
你会看到(基础),现在升级pip。 例子:
(base) C:\Users\Tom>cd ..
(base) C:\Users>cd ..
(base) C:\>python -m pip install --upgrade pip
Requirement already up-to-date: pip in g:\anaconda3\lib\site-packages (20.0.2)
(base) C:\>pip -V
pip 20.0.2 from G:\Anaconda3\lib\site-packages\pip (python 3.7)
# Try install
(base) C:\>pip install selenium
这将花费较长的时间,但也将安装或升级Anaconda内部使用的SSL库。继续前进
Windows 10 如果你想在正常的cmd中使用pip,而不仅仅是在Anaconda提示符中。您需要添加3个环境路径。 比如:
D:\Anaconda3
D:\Anaconda3\Scripts
D:\Anaconda3\Library\bin
大多数人只添加D:\Anaconda3\Scripts
对于未来试图解决这个问题的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
对于Windows 10下的Miniconda3, python=3.7.5,我尝试了以上所有建议;毫无效果。我不得不降级到python=3.7.0,这解决了这个问题
conda install python=3.7.0
显然这很混乱。答案表明升级到3.8.5也可以工作,但这在我的环境中有太多的副作用。
我使用的是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