PIP和conda 更換國內(nèi)安裝源的方法步驟
conda 更換國內(nèi)安裝源
全局
Anaconda 是一個用于科學計算的 Python 發(fā)行版,支持 Linux, Mac, Windows, 包含了眾多流行的科學計算、數(shù)據(jù)分析的 Python 包。
Anaconda 安裝包可以到 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 下載。
TUNA 還提供了 Anaconda 倉庫與第三方源(conda-forge、msys2、pytorch等,查看完整列表)的鏡像,各系統(tǒng)都可以通過修改用戶目錄下的 .condarc 文件。Windows 用戶無法直接創(chuàng)建名為 .condarc 的文件,可先執(zhí)行 conda config --set show_channel_urls yes 生成該文件之后再修改。
注:由于更新過快難以同步,我們不同步pytorch-nightly, pytorch-nightly-cpu, ignite-nightly這三個包。
channels: - defaults show_channel_urls: true channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda default_channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2 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 simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
即可添加 Anaconda Python 免費倉庫。
運行 conda clean -i 清除索引緩存,保證用的是鏡像站提供的索引。
運行 conda create -n myenv numpy 測試一下吧。
臨時
安裝cuda:
conda install cudatoolkit=8.0 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/
安裝cudnn:
conda install cudnn=7.0.5 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/
PIP 更換國內(nèi)安裝源
pip國內(nèi)的一些鏡像
阿里云 http://mirrors.aliyun.com/pypi/simple/
中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
中國科學技術(shù)大學 http://pypi.mirrors.ustc.edu.cn/simple/
修改源方法:
臨時使用:
可以在使用pip的時候在后面加上-i參數(shù),指定pip源
eg: pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple
永久修改:
linux:
修改 ~/.pip/pip.conf (沒有就創(chuàng)建一個), 內(nèi)容如下:
[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple
到此這篇關(guān)于PIP和conda 更換國內(nèi)安裝源的方法步驟的文章就介紹到這了,更多相關(guān)PIP和conda 更換國內(nèi)安裝源內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
python PIL和CV對 圖片的讀取,顯示,裁剪,保存實現(xiàn)方法
今天小編就為大家分享一篇python PIL和CV對 圖片的讀取,顯示,裁剪,保存實現(xiàn)方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2019-08-08
基于Matplotlib?調(diào)用?pyplot?模塊中?figure()?函數(shù)處理?figure圖形對象
這篇文章主要介紹了基于Matplotlib?調(diào)用?pyplot?模塊中?figure()?函數(shù)處理?figure圖形對象,matplotlib.pyplot模塊能夠快速地生成圖像,但如果使用面向?qū)ο蟮木幊趟枷?,我們就可以更好地控制和自定義圖像,下面就來詳細介紹其內(nèi)容,需要的朋友可以參考下2022-02-02
Python一句代碼實現(xiàn)找出所有水仙花數(shù)的方法
今天小編就為大家分享一篇Python一句代碼實現(xiàn)找出所有水仙花數(shù)的方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-11-11
python實現(xiàn)html轉(zhuǎn)ubb代碼(html2ubb)
這篇文章主要介紹了python實現(xiàn)html轉(zhuǎn)ubb代碼(html2ubb),使用正則表達式寫的一個函數(shù),需要的朋友可以參考下2014-07-07
python orm 框架中sqlalchemy用法實例詳解
這篇文章主要介紹了python orm 框架中sqlalchemy用法,結(jié)合實例形式詳細分析了Python orm 框架基本概念、原理及sqlalchemy相關(guān)使用技巧,需要的朋友可以參考下2020-02-02
解決python報錯ImportError:urllib3?v2.0?only?supports?OpenSSL
這篇文章主要介紹了解決python報錯ImportError:urllib3?v2.0?only?supports?OpenSSL?1.1.1+的相關(guān)資料,文中通過代碼介紹的非常詳細,需要的朋友可以參考下2023-12-12

