Python pip修改镜像源为豆瓣源
常常遇到pip装包时速度过慢或者无法安装(请求超时)等问题,这个时候你就需要考虑一下给pip换源了
-i https://pypi.doubanio.com/simple
-i https://pypi.douban.com/simple
pip install -r requirements.txt or "package name"-i https://pypi.douban.com/simple
pip install -r requirements.txt or "package name"-i https://pypi.doubanio.com/simple
pip install -r requirements.txt -i https://pypi.doubanio.com/simple
pip install pygame -i https://pypi.doubanio.com/simple
pip install -r requirements.txt -i https://pypi.douban.com/simple
pip install pygame -i https://pypi.douban.com/simple
其他源:
阿里云 https://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
这两个示例方法一般
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/cloud/conda-forge/
conda config --set show_channel_urls yes
conda config --remove-key channels
这里不推荐使用永久的方法,不做详解
pip install **.whl (写全该文件的路径)
conda install --use-local **.tar.bz2