2009-10-18 36 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文件。