python - 无法创建 conda 环境
问题描述
当我尝试创建环境时出现错误消息。我已经安装了 Anaconda3,它与 python3.7 一起安装,并且我已经在我的 window10 机器上设置了环境变量。通过使用 jupyter notebook,我从事机器学习方面的工作。但我无法在其上导入 tensorflow 库。所以我尝试安装一个环境。在我的 cmd 我试过
conda create -n tfp3.6 python=3.6
C:\>conda create -n tfp3.6 python=3.6
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/noarch/repodata.json.bz2>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/main/noarch/repodata.json.bz2 (Caused by SSLError("Can\'t connect to HTTPS URL because the SSL module is not available."))'))
这是我的环境变量 这是我的环境变量
请帮忙。提前致谢
解决方案
这很可能是某些 Windows 系统上的 Python3.7 问题。
问题的根源隐藏在错误消息的尾部:"SSLError("Can\'t connect to HTTPS URL because the SSL module is not available.")"
在某些 Windows 上运行的 Python3.7 会出现此问题(我在 Windows 10 上遇到过此问题)。解决方法是:安装使用Python3.6
PS:就我而言,我发现了这个问题的非常棘手的表现:代码在 conda-shell 下成功运行,在 Jupyter-notebook 下成功运行,但无法从 cmd 运行,python.exe 取自 conda 安装或 conda-created环境。
为确保您遇到同样的问题,您可以在 cmd 中运行此行:
python -c "导入请求;响应 = requests.get(' https://stackoverflow.ru ', cert=False); print(response);"
(假设安装了 requests 包,例如通过 cmd 执行:“pip install requests”)
这个cmd执行应该在anaconda-shell下运行成功,但是在python3.7下运行失败
推荐阅读
- javascript - 从 Vuex 商店返回的结构中的神秘空字段
- python - AWS Lambda 和 Fastapi:获取状态码 307
- .net - swagger.json 链接未显示在 swagger 页面中
- javascript - × TypeError:当我更改输入字段中的数据时,无法设置未定义的属性“名称”
- sql - TSQL - 如何避免 UNION ALL
- python - Certbot + Nginx infinite redirect loop fix?
- r - 如何在闪亮中创建 ggraph 反应式布局
- django - 如何从 Django 中的嵌套 M2M 字段中查询记录?
- c++ - BigInt 乘法和 to_string 实现输出太多零
- flutter - 如何使用 Google 移动广告显示静态横幅广告并使用 SafeArea 小部件包装它?