2

这与我不久前问的这个问题有关。

最终的结果是我希望能够安装我的包“identity.model”和所有依赖项。像这样...

$ easy_install -f http://eggs.sadphaeton.com identity.model
Searching for identity.model
Reading http://eggs.sadphaeton.com
Reading http://pypi.python.org/simple/identity.model/
Couldn't find index page for 'identity.model' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for identity.model
error: Could not find suitable distribution for Requirement.parse('identity.model')

无论出于何种原因,运行此 easy_install 都会访问我根据此信息布置的主页

我的 index.html

<html>
 <head>
     <title>SadPhaeton Egg Repository</title>
 </head>
 <body>
    <a rel="homepage" href="AlchemyExtra">AlchemyExtra</a>
    <a rel="homepage" href="identity.model">identity.model</a>
    <a rel="homepage" href="repoze.what.plugins.config">repoze.what.plugins.config</a>

 </body>
</html>

如果我跑...

$ easy_install -i http://eggs.sadphaeton.com identity.model

它确实找到了我的包和我放在那里的 repoze.what.plugins.config,因为它是一个依赖项。但是,当它去获取 tw.forms(托管在 pypi 上的外部依赖项)时,它以失败告终,因为它只搜索了http://eggs.sadphaeton.com

显然我误解了“规范”。有人知道诀窍是什么吗?

4

3 回答 3

3

-f 将获取您提供的 url,并在那里查找包以及 PyPI。此类页面的一个示例是http://dist.plone.org/release/3.3.1/如您所见,这是一个分发文件列表。

使用 -i 定义主索引页面。它默认为http://pypi.python.org/simple/如您所见,索引页面是包的索引,而不是分发文件的索引。

所以在你的情况下easy_install -i http://eggs.sadphaeton.com identity.model应该可以下载identity.model。它对我有用,就像中间两次,但不是第一次也不是第二次。我不知道您是否正在尝试不同的格式?但无论如何,它会在 tw.forms 上失败,因为它不在您的索引页面上。

所以解决方案应该是制作一个像http://dist.plone.org/release/3.3.1/这样的页面,上面有你的鸡蛋。我不知道格式必须有多精确,但我认为它非常灵活。

更新:

这是一步解决方案的步骤:

  1. 将所有发行版放在一个目录中。
  2. cd 到那个目录。
  3. 类型python -c "from SimpleHTTPServer import test; test()"
  4. 现在输入easy_install -f http://localhost:8080/ <modulename>

它将安装模块。

于 2009-10-18T15:42:23.393 回答
0

看起来诀窍在于在根目录的 index.html 上有 rel="download" 链接。

<html>
<head>
    <title>SadPhaeton Egg Repository</title>
</head>
<body>
    <a rel="homepage" href="AlchemyExtra">AlchemyExtra</a> <a rel="download" href="AlchemyExtra/AlchemyExtra-0.0dev-py2.6.egg">download</a><br>
    <a rel="homepage" href="identity.model">identity.model</a> <a rel="download" href="identity.model/identity.model-0.0dev-py2.6.egg">download</a><br>

    <a rel="homepage" href="repoze.what.plugins.config">repoze.what.plugins.config</a> <a rel="download" href="repoze.what.plugins.config/repoze.what.plugins.config-0.0.0-py2.6.egg">download</a><br>

</body>
</html>

这解决了我的直接问题,但如果规范中有更多详细信息会很好。根据我读到的内容,我期望easy_install 会咨询主页以获取下载链接,但它似乎不想为我这样做。

现在以某种方式自动执行此操作,因为手动执行此废话是 PITA。

于 2009-10-18T16:52:34.363 回答
0

问题是你试图混合使用 -i 和 -f 模式来制作你的页面;你需要选择一个或另一个,因为这些rel=""东西适用于 -i。

如果你想使用 -f 模式,那么你只需要一个包含鸡蛋的 webserver 目录。如果要使用 -i,则必须为每个项目创建一个子目录,其中包含一个 index.html,并且这些 index.html 文件将包含这些rel="homepage"内容。

于 2010-01-29T18:34:59.917 回答