Windows+Anaconda快速升级文件包(速查)
最近pytorch版本已经到1.20了,我还在用老版本,半年没怎么动anaconda了,决定升级新版本,
但网络总是碰到问题,见怪不怪,不过每升级一次,问题都类似,所以记录一下自己的办法,也算是来个速查吧!
关于如何离线下载并安装,参考此贴的离线安装部分即可:https://blog.csdn.net/tanmx219/article/details/82814738
注意我这里没有配置国内镜像,主要是以前使用镜像,貌似使用anaconda的过程中会有些其他麻烦,现在也想不起来,所以依然采取不使用镜像的办法来实现快速安装。
要做的事很简单
主要事件就是下载文件包,完成后,拷贝pytorch-1.2.0-py3.7_cuda100_cudnn7_1.tar.bz2文件到D:\Anaconda3\pkgs,然后有两件事必须做,
其一是urls.txt要填好下载地址,我也不知道填哪个,两个都填上了,
https://anaconda.org/pytorch/pytorch/1.2.0/download/win-64/pytorch-1.2.0-py3.7_cuda100_cudnn7_1.tar.bz2
https://conda.anaconda.org/pytorch/win-64/pytorch-1.2.0-py3.7_cuda100_cudnn7_1.tar.bz2
其二是解压缩(不解压缩的话,conda会默认为没有下载完成,然后删除原文件再重新下载)
大致做事的过程
下面是我安装时的过程,
(torch) C:\Users\Administrator>conda install pytorch torchvision -c pytorch
Collecting package metadata: done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.6.14
latest version: 4.7.11
Please update conda by running
$ conda update -n base -c defaults conda
## Package Plan ##
environment location: d:\Anaconda3\envs\torch
added / updated specs:
- pytorch
- torchvision
The following packages will be downloaded:
package | build
---------------------------|-----------------
openssl-1.0.2t | vc14h62dcd97_0 5.8 MB defaults
pytorch-1.2.0 |py3.7_cuda100_cudnn7_1 479.3 MB pytorch
torchvision-0.4.0 | py37_cu100 2.3 MB pytorch
------------------------------------------------------------
Total: 487.4 MB
The following packages will be UPDATED:
openssl 1.0.2s-he774522_0 --> 1.0.2t-vc14h62dcd97_0
pytorch 1.0.1-py3.7_cuda100_cudnn7_1 --> 1.2.0-py3.7_cuda100_cudnn7_1
torchvision pytorch/noarch::torchvision-0.2.1-py_2 --> pytorch/win-64::torchvision-0.4.0-py37_cu100
vs2015_runtime 14.15.26706-h3a45250_0 --> 14.16.27012-hf0eaf9b_0
Proceed ([y]/n)? y
Downloading and Extracting Packages
pytorch-1.2.0 | 479.3 MB | | 0%
torchvision-0.4.0 | 2.3 MB | ############################################################################ | 100%
openssl-1.0.2t | 5.8 MB | ############################################################################ | 100%
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/pytorch/win-64/pytorch-1.2.0-py3.7_cuda100_cudnn7_1.tar.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.
anaconda这里是下载不下来的,然后找到国内镜像
https://mirror.tuna.tsinghua.edu.cn/help/anaconda/
channels:
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
其中的实质下载地址:
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/win-64/
pytorch-1.2.0-py3.7_cuda100_cudnn7_1.tar.bz2 | 479.3 MiB | 2019-08-10 23:53 |
我就是在这里下载的包。
关于anaconda上的下载地址,
https://anaconda.org/pytorch/pytorch/1.2.0/download/win-64/pytorch-1.2.0-py3.7_cuda100_cudnn7_1.tar.bz2
conda上还有一个链接,
https://conda.anaconda.org/pytorch/win-64/pytorch-1.2.0-py3.7_cuda100_cudnn7_1.tar.bz2
下载时,最终指向的都是同一个下载地址,
https://binstar-cio-packages-prod.s3.amazonaws.com/5a11....
下载下来就可以离线安装了。