pip更换源 windows10_Conda及Pip换源处理
生活随笔
收集整理的這篇文章主要介紹了
pip更换源 windows10_Conda及Pip换源处理
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Pip 換源
在 user home 目錄下新建一個 ~/.pip/pip.config 文件,添加如下配置:
[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple如果想要臨時更換 pip 源,則可以在相應的 pip 命令調用時,在命令的最后加上:
-i https://pypi.tuna.tsinghua.edu.cn/simpleConda 換源
在 user home 目錄下新建一個 .condarc 文件,添加如下配置:
channels:- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/- 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/- default ssl_verify: true show_channel_urls: truePytorch 包 Conda 下載緩慢的解決辦法
Pytorch 下載緩慢的原始是因為在 conda 下載時調用的源較差,Pytorch 的整個安裝耗時主要是在 cudatoolkit 和 Pytorch 安裝包上了,如果可以在網絡環境較好的 conda 源中找到這兩個包,就能解決速度慢的問題。
打開 Pytorch 官網,給出的 Linux 版本的安裝命令如下:
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch我們只需要去掉該命令最后的 -c pytorch,這樣在安裝的時候就會默認調用用戶在系統中設定的默認鏡像源:
conda install pytorch torchvision cudatoolkit=10.1參考資料:
- conda安裝Pytorch下載過慢解決辦法(11月26日更新ubuntu下pytorch1.3安裝方法)_watermelon1123的博客-CSDN博客_conda安裝pytorch
總結
以上是生活随笔為你收集整理的pip更换源 windows10_Conda及Pip换源处理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python 进位_Python小课堂(
- 下一篇: iphone桌面横屏设置在哪里_iPho