换源-pip-ubuntu-CentOS

软件仓库源

清华大学开源软件镜像站 https://mirrors.tuna.tsinghua.edu.cn/
阿里巴巴OPSX软件仓库 https://opsx.alibaba.com/mirror

pip源

阿里云 http://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/

pip 换源

安装包时,使用-i指定源
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple mysqldb

修改默认设置

linux的文件在 ~/.pip/pip.conf
windows在 %HOMEPATH%\pip\pip.ini
没有目录需要自己创建

[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host=pypi.douban.com

ubuntu 换源

备份系统源

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

修改sudo vim /etc/apt/sources.list

Ubuntu 14.04.5 LTS

deb https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

## Not recommended
# deb https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

更新生效

sudo apt-get update
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容