西安网站开发的未来发展,易企网络网站建设,建设信用卡网站首页,服务平台登录使用easy_install和pip可以让python的模块的安装和管理变得非常方便。我一般在新的Linux系统上#xff0c;先easy_install pip然后就用pip安装其他的模块了。 不过#xff0c;在国内用官方的pypi源#xff08;https://pypi.python.org/simple#xff09;一般比较慢#xf…使用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.tsinghua.edu.cn/simple 1. 命令行安装时临时使用pypi镜像即添加 -i https://pypi.tuna.tsinghua.edu.cn/simple 参数即可 # easy_install 命令行
easy_install -i https://pypi.tuna.tsinghua.edu.cn/simple pip# pip install 命令行pip install -i https://pypi.tuna.tsinghua.edu.cn/simple lxml 2. 设置easy_install和pip的配置文件永久设置pypi镜像源命令行就不用-i参数了easy_install的配置文件 ~/.pydistutils.cfg 在其中添加如下配置 [easy_install]
index_url https://pypi.tuna.tsinghua.edu.cn/simple pip的配置文件 ~/.pip/pip.conf 可能需要创建.pip目录及pip.conf文件在其中添加如下配置 pip pypi镜像源配置Shell [global]
index-url https://pypi.tuna.tsinghua.edu.cn/simple 转载于:https://www.cnblogs.com/richiewlq/p/8909373.html