V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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 · Dec 28, 2016 · 5419 views
    This topic created in 3417 days ago, the information mentioned may be changed or developed.
    如题,安装时下载速度如何?我按照搜素到的一些方法,设置为阿里云的镜像,但是最近速度很慢,最高十几 kb ,基本上都是几 kb ,经常 time out ,让人抓狂啊
    Supplement 1  ·  Dec 30, 2016
    在网上找了好久,终于解决了 找到一位大神的办法,主要之前设置的豆瓣镜像的地址不对,这个是 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 replies    2017-01-04 13:41:51 +08:00
    dofine
        1
    dofine  
       Dec 28, 2016   ❤️ 1
    hujianxin
        2
    hujianxin  
       Dec 28, 2016   ❤️ 1
    `cat ~/.pip/pip.conf`

    ```
    [global]
    index-url=https://pypi.douban.com/simple
    ```
    sylecn
        3
    sylecn  
       Dec 28, 2016   ❤️ 1
    ~/.pip/pip.conf

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

    [global]
    index-url = http://mirrors.aliyun.com/pypi/simple/
    [install]
    trusted-host=mirrors.aliyun.com
    yanzixuan
        19
    yanzixuan  
       Jan 4, 2017
    polipo 转发 shadowsocks. 好用。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4020 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 66ms · UTC 04:24 · PVG 12:24 · LAX 21:24 · JFK 00:24
    ♥ Do have faith in what you're doing.