下载好了annaconda,但是在创建一个新的Conda虚拟环境报错

文章目录

问题描述:

ProxyError(MaxRetryError("HTTPSConnectionPool(host='repo.anaconda.com', port=443): Max retries exceeded with url: /pkgs/pro/win-64/repodata.json.bz2 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000001D7D7A02208>: Failed to establish a new connection: [WinError 10061] 由于目标计 算机积极拒绝,无法连接。',)))",),)

解决方案

1.生成一个配置文件

1.1cmd中输入

python 复制代码
conda config --set show_channel_urls yes

1.2查看C盘/用户/电脑用户名下是否生成.condarc文件。我的如下

1.3以记事本方式打开此文件

复制以下内容进去,保存即可(可在图片下方复制)

python 复制代码
channels:
  - defaults
show_channel_urls: true
default_channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch-lts: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

1.4 重新输入创建虚拟环境的命令即可成功创建(如)

python 复制代码
conda create -n env_name python=3.6 

问题总结

1.主要是annaconda是官网的,需要科学上网,我们需要配置镜像来访问

相关推荐
羊羊小栈15 小时前
AI赋能电力巡检:智能故障预警系统
人工智能·yolo·目标检测·毕业设计·大作业
彦为君16 小时前
Agent 安全:从权限提示到沙箱隔离
python·ai·ai编程
PILIPALAPENG16 小时前
Python 语法速成指南:前端开发者视角(JS 类比版)
前端·人工智能·python
用户83562907805117 小时前
Python 操作 PowerPoint 页眉与页脚指南
后端·python
枫叶林FYL18 小时前
项目九:异步高性能爬虫与数据采集中枢 —— 基于 Crawl<sub>4</sub>AI 与 Playwright 的现代化数据采集平台 项目总览
爬虫·python·深度学习·wpf
猫猫的小茶馆18 小时前
【Python】函数与模块化编程
linux·开发语言·arm开发·驱动开发·python·stm32
Miss_min19 小时前
128K长序列数据生成
开发语言·python·深度学习
love530love19 小时前
MingLi-Bench 项目部署实录:基于 EPGF 架构的工程化实践
人工智能·windows·python·架构·aigc·epgf·mingli-bench
猿儿本无心19 小时前
快速搭建Python项目(Vscode+uv+FastAPI)
vscode·python·uv