首页 > 代码库 > pip 修改镜像源为豆瓣源

pip 修改镜像源为豆瓣源

1. 修改配置文件

编辑配置文件,如果没有则新建:

$ vi ~/.pip/pip.conf

添加内容如下:

[global]index-url = https://pypi.doubanio.com/simple

2. 命令行选项

使用 pip 命令安装扩展包时指定源:

$ pip install SQLAlchemy -i https://pypi.doubanio.com/simple

 

参考链接:

  1. pip修改官方源为豆瓣源 | cls1991的个人博客
  2. pip 更换软件镜像源 - 简书

 

pip 修改镜像源为豆瓣源