windows 10安装Anaconda后pip报SSL错解决

问题

新装的系统,安装anaconda(python=3.7)后

# pip install xxx
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting xxx
    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/xxx/
  ......
     Could not fetch URL https://pypi.org/simple/xxx/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/ssl/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
    Could not find a version that satisfies the requirement xxx(from versions: )
No matching distribution found for xxx
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都是直接用的,现在安装了最新的版本反而直接出错,找了很多地方都没解决,思考一下,ssl模块出错。

# python
Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import _ssl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed: 找不到指定的模块。

可能openssl没有安装的原因,所以装了一下openssl,https://slproweb.com/products/Win32OpenSSL.html
可以下载编译好的,或者以任何方式安装openssl,再次运行pip正常。

更新,评论里有人贴了更好的解决办法,把Anaconda3\Library\bin也添加到环境变量即可解决。

评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值