easy_install f与easy_install i之比较

2024-05-29 03:52:56 发布

您现在位置:Python中文网/ 问答频道 /正文

这与我不久前提出的this问题有关。在

最后我想安装我的软件包”标识.型号“以及所有依赖关系。像这样。。。在

$ 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')

不管出于什么原因,运行这个简单的安装程序会进入我根据this information布局的主页

我的索引.html在

^{pr2}$

如果我跑。。。在

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

它确实找到了我的包裹和什么插件.config我也放在那里,因为它是一个依赖项。但是当它去拿的时候tw.表格(托管在pypi上的外部依赖)它以失败告终,因为它只搜索http://eggs.sadphaeton.com

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


Tags: installorgpypicomhttpformodeleasy
3条回答

问题是,您试图混合使用-i和-f模式来制作页面;您需要选择其中一种,因为只有的rel=""stuff与-i一起工作

如果您想使用-f模式,那么您只需要一个包含鸡蛋的web服务器目录。如果要使用-i,则必须为每个项目提供一个子目录索引.html在里面,就是那些索引.html包含rel="homepage"内容的文件。在

-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应该可以下载标识.型号. 对我来说,就像中间两次,但不是第一次也不是第二次。我不知道你是否在尝试不同的格式?但无论如何,它都会失败tw.表格,因为它不在你的索引页上。在

所以解决方案应该是制作一个类似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>

它将安装模块。在

看起来窍门是在索引.html根的。在

<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_nu安装会参考主页下载链接,但它似乎不想为我这样做。在

现在要想办法使之自动化,因为手工操作是一个陷阱。在

相关问题 更多 >

    热门问题