Buildout - 允许主机下载包

Buildout - Allow hosts for package download

我有一个 Plone 5.0.5 部署,需要 ZODB 复制包 zc.zrs。将信息添加到 buildout.cfg 后,我在索引参数上添加了 URL https://pypi.org/simple

[buildout]
extends = 
    base.cfg
    versions.cfg
index = https://pypi.org/simple

然后我 运行 构建并得到以下错误:

# sudo -u plone_buildout bin/buildout

Installing 'plone.recipe.zeoserver[zrs]'.
We have the distribution that satisfies 'plone.recipe.zeoserver[zrs]==1.2.9'.
Getting required 'zc.zrs'
We have no distributions for zc.zrs that satisfies 'zc.zrs'.
Download error on https://pypi.org/simple: hostname 'pypi.org' doesn't match either of 'www.python.org', '*.python.org', 'docs.python.org', 'downloads.python.org', 'pypi.python.org' -- Some packages may not be found!
Download error on https://pypi.org/simple/zc.zrs/: hostname 'pypi.org' doesn't match either of 'www.python.org', '*.python.org', 'docs.python.org', 'downloads.python.org', 'pypi.python.org' -- Some packages may not be found!
Couldn't find index page for 'zc.zrs' (maybe misspelled?)
Download error on https://pypi.org/simple/: hostname 'pypi.org' doesn't match either of 'www.python.org', '*.python.org', 'docs.python.org', 'downloads.python.org', 'pypi.python.org' -- Some packages may not be found!
Getting distribution for 'zc.zrs'.
Couldn't find index page for 'zc.zrs' (maybe misspelled?)
Could't load zc.buildout entry point default
from plone.recipe.zeoserver[zrs]:
Couldn't find a distribution for 'zc.zrs'..
While:
  Installing.
  Getting section zeoserver.
  Initializing section zeoserver.
  Installing recipe plone.recipe.zeoserver[zrs].
  Getting distribution for 'zc.zrs'.
Error: Couldn't find a distribution for 'zc.zrs'.

在做了一些研究后发现扩建使用 easy_install,并尝试添加 this documentation 中描述的一些参数,但我得到了同样的错误,比如没有改变任何东西。

如何允许从 Plone buildout PyPI 下载?

默认情况下,Plone buildout 应该可以从 pypi 下载。 检查您是否可以使用 wget 下载到您的下载文件夹:

wget https://files.pythonhosted.org/packages/5c/b2/5a516f4883fc766ea37a9d979a5cacddc1b29df17140c14da26676a3c4b5/zc.zrs-3.1.0.tar.gz

如果您使用默认安装程序,您的 buildout-cache 文件夹中应该有一个下载文件夹。 当服务器有一些奇怪的网络配置并且无法直接下载某些包时,我有时会这样做。