Python 豆瓣pip使用

来源:互联网 发布:程序员出差携带 编辑:程序博客网 时间:2024/06/03 07:32

eg:

pip install -i https://pypi.douban.com/simple pandas


1、命令行式指定镜像地址 

pip install -i http://pypi.douban.com/simple/ packagename


清华大学的镜像

           https://pypi.tuna.tsinghua.edu.cn/simple


2、配制成默认的话,需要创建或修改配置文件(linux的文件放在~/.pip/pip.conf,windows在%HOMEPATH%\pip\pip.ini,目录不存在,手动创建) 

[druid@master .pip]$ pwd 
/home/druid/.pip 
[druid@master .pip]$ more pip.conf 
[global] 
index-url = https://pypi.tuna.tsinghua.edu.cn/simple 
[install] 
trusted-host = pypi.tuna.tsinghua.edu.cn