博客
关于我
Anaconda清华镜像下载大文件频繁出错
阅读量:584 次
发布时间:2019-03-11

本文共 1950 字,大约阅读时间需要 6 分钟。

优化后的文章:

使用Anaconda配置PyTorch GPU环境时的断连问题解决方案

在我最近的工作中,这个问题让我有点烦恼。每当我尝试下载cuwatoolkit包时,网络就不断断连,看来安装体验都没想象中那样顺利。后来,我在GitHub上找到了官方的解决方案,这过程让我学到了不少有趣的知识。

我首先尝试通过清华大学的镜像站来解决问题。为了确认网络连接是否正常,我运行了以下命令:

tracert mirrors.tuna.tsinghua.edu.cn

结果显示,最多经过30个跃点到达目的地。看来网络连接没问题,我可以尝试使用清华大学的镜像站来解决问题。

根据官方建议,镜像站的地址是:

https://mirrors.bfsu.edu.cn/anaconda/

为了让Anaconda能够使用这些镜像站,我需要修改配置文件。文件应该存在于我的用户目录下的 .condarc 文件中。配置文件的内容可设定如下:

channels:  - defaults  show_channel_urls: true  default_channels:    - https://mirrors.bfsu.edu.cn/anaconda/pkgs/main    - https://mirrors.bfsu.edu.cn/anaconda/pkgs/r    - https://mirrors.bfsu.edu.cn/anaconda/pkgs/msys2custom  conda-forge:    - https://mirrors.bfsu.edu.cn/anaconda/cloud  msys2:    - https://mirrors.bfsu.edu.cn/anaconda/cloud  bioconda:    - https://mirrors.bfsu.edu.cn/anaconda/cloud  menpo:    - https://mirrors.bfsu.edu.cn/anaconda/cloud  pytorch:    - https://mirrors.bfsu.edu.cn/anaconda/cloud  simpleitk:    - https://mirrors.bfsu.edu.cn/anaconda/cloud

添加了这些镜像源后,我需要清理索引缓存,以确保索引信息是最新的。运行以下命令:

conda clean -i

然后,我可以创建一个新的环境测试:

conda create -n myenv numpy

如果在Linux系统中使用,可以通过以下命令添加更多镜像源:

conda config --add channels https://mirrors.bfsu.edu.cn/anaconda/pkgs/mainconda config --add channels https://mirrors.bfsu.edu.cn/anaconda/pkgs/rconda config --add channels https://mirrors.bfsu.edu.cn/anaconda/pkgs/msys2conda config --add channels https://mirrors.bfsu.edu.cn/anaconda/cloud/pytorchconda config --add channels https://mirrors.bfsu.edu.cn/anaconda/cloud/conda-forgeconda config --add channels https://mirrors.bfsu.edu.cn/anaconda/cloud/msys2conda config --add channels https://mirrors.bfsu.edu.cn/anaconda/cloud/biocondaconda config --add channels https://mirrors.bfsu.edu.cn/anaconda/cloud/menpoconda config --add channels https://mirrors.bfsu.edu.cn/anaconda/cloud/simpleitkconda create -n pytorch3.8-gpu python=3.8conda clean -i

通过这些步骤,我可以顺利地安装PyTorch GPU环境,解决了之前的断连问题。这次的修补体验让我对Anaconda的配置有了更深入的了解,也让我意识到镜像站的重要性。

转载地址:http://ddevz.baihongyu.com/

你可能感兴趣的文章
OpenForest 开源项目安装与使用指南
查看>>
OpenGL glBlendFunc() 设置颜色混合 透明度叠加计算
查看>>
opengl 教程(15) 摄像机控制(2)
查看>>
opengl 深度详解,多重采样时,如何在OpenGL纹理中解析深度值?
查看>>
OpenGL 的内置矩阵种种
查看>>
OpenGL/OpenGL ES 入门:基础变换 - 初识向量/矩阵
查看>>
OpenGL中shader读取实现
查看>>
OpenGL中旋转平移缩放等变换的顺序对模型的影响
查看>>
Opengl中的gluProject函数认识
查看>>
OpenGl介绍
查看>>
OPENGL半透明图像产生黑色光环
查看>>
OpenGL和图形卡
查看>>
OpenGL字体绘制
查看>>
OpenGL学习
查看>>
openGL学习步骤
查看>>
OpenGL的基本概念介绍
查看>>
OpenGL着色器、纹理开发案例
查看>>
OpenGL程序无法启动此应用程序,因为计算机中丢失glut32.dll(转))
查看>>
opengl绘制几何体的函数
查看>>
openGL缓存概念和缓存清除(01)
查看>>