How do I use easy_install and buildout when pypi is down?

后端 未结 7 1480
死守一世寂寞
死守一世寂寞 2021-02-01 23:26

I am using buildout to automatically download and setup the many dependencies of my Plone installation. buildout more or less uses easy_install to download and install a bunch o

相关标签:
7条回答
  • 2021-02-01 23:55

    Configure index in buildout.cfg, e.g.

    [buildout]
    index = http://a.pypi.python.org/
    find-links = 
    

    More mirrors on : http://www.pypi-mirrors.org/

    0 讨论(0)
  • 2021-02-02 00:01

    For the packages, that you need to install in your virtualenv usually through a requirements.txt (or may be individually), you have to override your pip.conf file, usually located at ~/.pip/pip.conf

    In your pip.conf file:

    [global]
    index-url=https://pypi.python.org/simple/
    
    [install]
    trusted-host=pypi.python.org
    

    Here you can provide the url of your own custom version of pypi if needed.

    If you wish to also use another pypi server while creating virtualenv through easy_install you need to override pydistutils.cfg file usually located at ~/pydistutils.cfg

    In pydistutils.cfg file:

    [easy_install]
    index-url=https://pypi.python.org/simple/
    

    This would ensure to create your venv with the url of pypi mentioned in pydistutils.cfg. Here, we're telling easy_install to use https://pypi.python.org/simple/ for creating venvs.

    0 讨论(0)
  • 2021-02-02 00:05

    Here are instructions on how to setup your own PyPi mirror. The homepage of this project is here. There also seems to be a growing number of mirrors out there.

    For instructions on how to setup your own package index, check out this blog post where one solution is explained at the end. Then you can also host your own internal packages in there. The advantage is also that the versions are fixed that way. (For a way to pin the versions directly in buildout, check out this post).

    If there is only metadata on PyPI and the archive is stored somewhere else you might of course copy that over to your index as well. If you just use a PyPI mirror I assume that you still need access to these servers.

    0 讨论(0)
  • 2021-02-02 00:05

    PyPI has had mirroring since mid 2010 http://pypi.python.org/mirrors

    0 讨论(0)
  • 2021-02-02 00:06

    This page shows how to use the alternate mirror mentioned in @moraes post, but for easy_install, buildout and virtualenv as well as pip:

    http://jacobian.org/writing/when-pypi-goes-down/

    0 讨论(0)
  • 2021-02-02 00:13

    You can also use a mirror. Put this in the "[global]" section of "~/.pip/pip.conf":

    index-url = http://d.pypi.python.org/simple/
    

    This is a recent feature as announced here.

    0 讨论(0)
提交回复
热议问题