美文网首页
python使用pip国内源

python使用pip国内源

作者: ddkangfu | 来源:发表于2016-12-27 14:57 被阅读0次

    python使用pip安装模块很方便,可是在国内官方源总是会间歇性的连接不上,其实python在国内也是有安装源的,比如豆瓣,下面是使用方法.

    pipy国内镜像目前有:

    http://pypi.douban.com/  豆瓣

    http://pypi.hustunique.com/  华中理工大学

    http://pypi.sdutlinux.org/  山东理工大学

    http://pypi.mirrors.ustc.edu.cn/  中国科学技术大学

    如果想手动指定源,可以在pip后面跟-i 来指定源,比如用豆瓣的源来安装web.py框架:

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

    注意后面要有/simple目录

    文件路径

    linux:

    ~/.pip/pip.conf

    windows:

    %HOME%\pip\pip.ini

    文件内容

    [global]

    index-url=http://pypi.douban.com/simple

    trusted-host=pypi.douban.com

    或者使用-i指令:

    easy_install-i http://pypi.douban.com/simple/ saltTesting

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

    相关文章

      网友评论

          本文标题:python使用pip国内源

          本文链接:https://www.haomeiwen.com/subject/amfevttx.html