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

安装Anaconda后使用pip安装包时出现SSL模块不可用的问题。通过安装openssl或将Anaconda路径添加到环境变量中解决了该问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题

新装的系统,安装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也添加到环境变量即可解决。

在处理Jupyter Notebook的安装与配置时,了解不同操作系统的特定步骤是至关重要的。这不仅关系到安装是否顺利,还涉及到后续使用时的性能和安全性。推荐您参考《Jupyter Notebook安装指南》这份资料,它将指导您在不同环境下完成Jupyter Notebook的安装和配置。 参考资源链接:[Jupyter Notebook安装指南](https://wenku.youkuaiyun.com/doc/6g91fv5ppz?spm=1055.2569.3001.10343) 首先,对于已经安装Anaconda的Linux系统,通常Jupyter Notebook已经包含在内。您可以通过运行`conda list jupyter`命令来检查安装情况。若未安装或需要升级,使用`conda install jupyter notebook`命令进行安装安装完成后,通过运行`jupyter notebook`来启动服务,并且可以通过`jupyter notebook --generate-config`命令生成配置文件,以便于后续的个性化设置。 如果您使用的是未安装Anaconda的Linux系统,则需要先安装Pythonpip。可以通过系统的包管理器来安装Python,并使用`apt-get install python3-pip`(Debian/Ubuntu)或相应的命令安装pip。接着,升级pip到最新版本以避免兼容性问题,使用`pip3 install --upgrade pip`。然后使用`pip3 install jupyter`进行Jupyter Notebook的安装安装完成后,同样通过运行`jupyter notebook`来启动服务。 在Windows系统中,首先需要下载并安装Python,并确保在安装过程中选择将Python添加到PATH环境变量。安装完成后,打开命令提示符(CMD)或PowerShell,输入`pip install jupyter`来安装Jupyter Notebook。之后,启动服务的命令依旧是`jupyter notebook`。 在整个安装和配置过程中,可能会遇到的常见问题包括权限不足、依赖冲突或是环境变量设置不正确。确保在执行安装命令时有足够的权限,并且在安装过程中仔细阅读提示信息,以便及时解决这些问题。例如,在Linux中,如果遇到权限问题,可以使用`sudo`命令来执行安装;在Windows中,则可能需要管理员权限运行命令提示符。 当Jupyter Notebook安装完成后,建议立即进行环境配置,包括但不限于设置工作目录、密码保护以及可能的远程访问配置。这些设置不仅可以提高工作效率,还能在一定程度上保障系统的安全性。 为了进一步提升您的配置技能并了解更多高级功能,建议在完成上述步骤后继续阅读《Jupyter Notebook安装指南》中的高级配置部分,其中包括了如何使用SSL加密、配置远程访问等高级话题。这将帮助您更全面地掌握Jupyter Notebook,使其成为您工作中的得力工具。 参考资源链接:[Jupyter Notebook安装指南](https://wenku.youkuaiyun.com/doc/6g91fv5ppz?spm=1055.2569.3001.10343)
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值