pip - 在 conda 环境中安装 pip
问题描述
我在 condarc 文件中有以下设置:
ssl_verify: true
use_pip: True
add_pip_as_python_dependency: True
channels:
- conda-forge
- defaults
proxy_servers:
http: proxyserver
https: proxyserver
我在公司代理后面使用 Anaconda,在 http: 和 https: 字段下提到了有关代理服务器的这些详细信息。
一旦我激活环境并发出以下命令:
pip install -r requirements.txt
我收到以下错误:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after
connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at
0x000002A615C950D0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/jinja2/
解决方案
对我来说,这似乎是一个 SSL 错误。我通过绕过来修复它,如下所示:
pip install -r requirements.txt —trusted-host pypi.org —trusted-host files.pythonhosted.org
如果您在公司网络中,则可能由于防火墙阻塞而发生。试试上面的解决方案。
推荐阅读
- mysql - 寻找工具以使用混合 bin_format 从一个 mysql 同步到另一个 mysql
- android - 使用 bundle 启动活动时如何使用 ActivityTestRule?
- python - 为每个过滤器 Python 创建多个新数据表
- c# - .Net Core 2 MVC Web App 中的 OpenID 识别
- c++ - 如何在具有依赖关系的 qbs 产品之间强制同步?
- android - HashMap 为空,因此我无法从 Firebase 数据库获取模拟器中显示的数据
- javascript - Autoprefixer 导致 node-sass 源映射指向错误的文件
- react-native - 来自 json GPS API 的 React Native 动态更新状态
- unity3d - AR 放置一个大小相同的物体
- mysql - mysql查询select sum where子句