2009-10-18 37 views
2

这与this问题有一定的关系。easy_install -f vs easy_install -i

最终的游戏是我想能够安装我的包“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的不管是什么原因打根据this information

我的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

很明显,我误解了“规范”。任何人都有任何想法是什么技巧?

回答

3

-f将采取您给它的网址,并在那里查找包以及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>

它将安装该模块。

+0

看起来像你引用的索引和我的索引之间的区别是那些都是源码分布,所以我不知道是否鸡蛋的分布会让这个更难。旁注:看起来像webfaction没有正确设置鸡蛋的MIME类型,我认为这也是使PIP失败。 – 2009-10-18 15:53:48

+0

不,主要区别在于它在一页上列出了所有的分布,即所有可用的文件。你列出了软件包,而不是发行版。 identity.model,与identity.model-0.0dev-py2.6.egg。另外,你的文件有错误的内容类型,这可能也是不同的。 – 2009-10-18 17:40:51

+0

换句话说,Plone列表只不过是一个目录列表,其中所有的文件名都链接到这些文件。我不知道rel =“download”是否相关,但是Plone列表没有它,PyPI索引也没有。 – 2009-10-18 17:43:25

0

看起来好像是在root的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。

+0

使用您的网络服务器制作一个目录列表,并粘贴该目录中的所有蛋。这应该做到这一点。我很确定Plone列表只是一个列出目录的nginx。 – 2009-10-18 17:45:35

0

问题是你正在尝试混合-i和-f模式来制作你的页面;你需要选择一个或另一个,因为rel=""东西只有与-i一起使用。

如果你想使用-f模式,那么你只需要一个带有egg的web服务器目录。如果你想使用-i,那么你必须有一个index.html的每个项目的子目录,它是那些包含rel="homepage"东西的index.html文件。