1. 程式人生 > >Windows10下更換conda和pip的源

Windows10下更換conda和pip的源

pip源更換:

在C:\Users\XXX下新建一個資料夾,重新命名為pip。

在pip資料夾裡面新建一個文字文件,並重新命名為:pip.ini,需要修改後綴。

在pip.ini裡面新增下面的資訊(採用阿里雲):

[global]

trusted-host = mirrors.aliyun.com

index-url = http://mirrors.aliyun.com/pypi/simple

conda源更換:

開啟CMD,輸入:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

conda config --set show_channel_urls yes

在C:\Users\XXX下有一個.condarc檔案,開啟之後應該是這樣的

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge

show_channel_urls: true

更新tensorflow:

pip install -U tensorflow