V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
alphadog619
V2EX  ›  Python

请教各位,你们的 pip 源如何设置的?

  •  1
     
  •   alphadog619 · 2016-12-28 13:23:37 +08:00 · 4531 次点击
    这是一个创建于 2673 天前的主题,其中的信息可能已经有所发展或是发生改变。
    如题,安装时下载速度如何?我按照搜素到的一些方法,设置为阿里云的镜像,但是最近速度很慢,最高十几 kb ,基本上都是几 kb ,经常 time out ,让人抓狂啊
    第 1 条附言  ·  2016-12-30 15:08:22 +08:00
    在网上找了好久,终于解决了 找到一位大神的办法,主要之前设置的豆瓣镜像的地址不对,这个是 https 的,实测下载速度飞快,希望可以帮到大家:

    python3 一行流:

    windows 系统,将以下一行代码粘贴到 python IDLE 中回车执行,将会自动建立 pip.ini,把 pip 源默认为豆瓣源。

    import os ; ini = "[global]\nindex-url = https://pypi.doubanio.com/simple/\n"; ; pippath=os.environ["USERPROFILE"]+"\\pip\\" ; exec("if not os.path.exists(pippath):\n\tos.mkdir(pippath)"); open(pippath+"/pip.ini","w+").write(ini)
    19 条回复    2017-01-04 13:41:51 +08:00
    dofine
        1
    dofine  
       2016-12-28 13:40:06 +08:00   ❤️ 1
    hujianxin
        2
    hujianxin  
       2016-12-28 13:44:53 +08:00   ❤️ 1
    `cat ~/.pip/pip.conf`

    ```
    [global]
    index-url=https://pypi.douban.com/simple
    ```
    sylecn
        3
    sylecn  
       2016-12-28 13:52:57 +08:00   ❤️ 1
    ~/.pip/pip.conf

    [global]
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple
    alphadog619
        4
    alphadog619  
    OP
       2016-12-28 13:59:28 +08:00
    谢谢以上几位,阿里、豆瓣、清华的镜像都试过了,一个 django 都装不上,也许是我网络有问题
    WildCat
        5
    WildCat  
       2016-12-28 14:09:51 +08:00 via iPhone
    http_proxy
    nyaruko
        6
    nyaruko  
       2016-12-28 14:24:32 +08:00   ❤️ 1
    我是自己用 nexus oss 搭的代理源,通过国外的代理服务器直接连接官方源
    Mark24
        7
    Mark24  
       2016-12-28 14:31:26 +08:00
    @alphadog619 只保留一个源试试,比如豆瓣
    wyntergreg
        8
    wyntergreg  
       2016-12-28 14:35:19 +08:00
    没设置过,速度尚可
    way2exp
        9
    way2exp  
       2016-12-28 14:43:37 +08:00
    你的网有问题 换运营商才是上策
    dsg001
        10
    dsg001  
       2016-12-28 17:26:14 +08:00
    默认设置,速度不错
    pheyer
        11
    pheyer  
       2016-12-28 17:27:49 +08:00
    今天亲测,豆瓣的源很快
    pheyer
        12
    pheyer  
       2016-12-28 17:28:25 +08:00   ❤️ 1
    我直接在命令上加-i https://pypi.douban.com/simple
    hareandlion
        13
    hareandlion  
       2016-12-28 18:04:27 +08:00 via iPhone
    豆瓣源一直满稳定
    raptor
        14
    raptor  
       2016-12-28 21:54:33 +08:00
    一直用豆瓣
    sunus
        15
    sunus  
       2016-12-28 21:55:16 +08:00
    阿里的源也不错
    alphadog619
        16
    alphadog619  
    OP
       2016-12-30 15:24:01 +08:00
    @pheyer 呃,竟然没仔细看你发的链接
    pheyer
        17
    pheyer  
       2016-12-30 15:32:56 +08:00
    @alphadog619 用我发的解决了?
    logeable
        18
    logeable  
       2016-12-31 20:19:45 +08:00
    windows 下
    用户目录\pip\pip.ini

    [global]
    index-url = http://mirrors.aliyun.com/pypi/simple/
    [install]
    trusted-host=mirrors.aliyun.com
    yanzixuan
        19
    yanzixuan  
       2017-01-04 13:41:51 +08:00
    polipo 转发 shadowsocks. 好用。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1518 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 17:08 · PVG 01:08 · LAX 10:08 · JFK 13:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.