最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
使用镜像源安装EASY_INSTALL和PIP教程
时间:2022-06-30 20:49:18 编辑:袖梨 来源:一聚教程网
使用easy_install和pip可以让python的模块的安装和管理变得非常方便。我一般在新的Linux系统上,先easy_install pip然后就用pip安装其他的模块了。 不过,在国内用官方的pypi源(https://pypi.python.org/simple)一般比较慢,甚至偶尔会直接连接timeout,所以很有必要使用pypi的国内镜像。关于镜像,我已推荐过,见这篇文章:常用的开源镜像站推荐
本文是讲一下通过两种方式来配置让easy_install和pip使用镜像pypi。 以清华大学的TUNA镜像源为例:https://pypi.tuna.*tsin*ghua.*edu.cn/simple
1. 命令行安装时临时使用pypi镜像,即:添加 -i https://pypi.tuna.*tsin*ghua.*edu.cn/simple 参数即可
# easy_install 命令行
easy_install -i https://pypi.tuna.*tsin*ghua.*edu.cn/simple pip
# pip install 命令行
pip install -i https://pypi.tuna.*tsin*ghua.*edu.cn/simple lxml
2. 设置easy_install和pip的配置文件,永久设置pypi镜像源,命令行就不用-i参数了
easy_install的配置文件 ~/.pydistutils.cfg 在其中添加如下配置:
[easy_install]
index_url = https://pypi.tuna.*tsin*ghua.*edu.cn/simple
pip的配置文件 ~/.pip/pip.conf (可能需要创建.pip目录及pip.conf文件),在其中添加如下配置:
pip pypi镜像源配置Shell
[global]
index-url = https://pypi.tuna.*tsin*ghua.*edu.cn/simple
相关文章
- 土豆视频网页版入口-土豆视频高清在线播放 12-01
- Hitomi.la最新镜像网站入口 - 2026可用国内访问地址分享 11-26
- 土豆视频网页版入口地址-土豆视频在线播放入口 11-17
- 哔哩哔哩官方网页版入口地址-哔哩哔哩blibili手机电脑网页版入口地址 11-16
- AO3镜像网站最新入口汇总 - 2026可用镜像链接列表 11-16
- 超星学生通登录入口-超星官网网页版登录入口 11-13