Completely solve the problem of slow pip downloading pytorch

Article Directory


Preface

  When using pip install to download the package, changing to a domestic mirror source can solve the problem of slow speed, but pytorch is still very slow. A new method has been tried these days, which can completely solve this problem. First attach some domestic mirror sources:

 https://pypi.douban.com/simple/  # 使用豆瓣源
 http://mirrors.aliyun.com/pypi/simple/  # 阿里云 
 https://pypi.mirrors.ustc.edu.cn/simple/ # 中国科技大学 
 http://pypi.douban.com/simple/   # 豆瓣(douban) 
 https://pypi.tuna.tsinghua.edu.cn/simple/   # 清华大学 
 http://pypi.mirrors.ustc.edu.cn/simple/   # 中国科学技术大学 

text

  Now let's introduce the method directly! ! ! In two steps, take the version I want to download as an example

  1. Enter the pytorch official website , the following figure shows the version I want to download: Insert picture description here
    then enter the download source of the official website, the black part of the above figure downloads the whl file you need, the circled part below is what I want to download, here is a sentence, torchaudio is I didn't install the pytorch package in the audio field. Insert picture description hereInsert picture description hereClick to download, so the download is still very slow, I recommend you to use Xunlei, click to download and copy the download path to Xunlei, the download speed takes off! Remember the location after the download is complete.
  2. Next, enter the environment you need to download through the command line. Insert picture description hereAfter entering the virtual environment, if you install it directly, because torch has some dependent packages (such as numpy), the seamounts will be very slow when downloading these packages, only about 10kb. Insert picture description hereTherefore, after downloading numpy from the mirror source given in the preface of the article, Insert picture description here
    enter the above instructions to install it, and it will be completed in a few seconds! ! ! If you are unsure of the dependent packages, you might as well install them directly to see what dependent packages affect the speed.

  This method is also valid for windows

Guess you like

Origin blog.csdn.net/qq_41831753/article/details/114118016