2014-01-27 185 views
1

我使用的pip 1.5.1直到今天都運行良好。無法用pip安裝舊版本

現在,我試圖在新的virtualenv中安裝requirements.txt,對於很多軟件包,它不能再爲大多數軟件包找到特定的舊版本。

$ pip install django-endless-pagination==1.1 
Downloading/unpacking django-endless-pagination==1.1 
    Could not find a version that satisfies the requirement django-endless-pagination==1.1 (from versions: 2.0) 
    Some externally hosted files were ignored (use --allow-external to allow). 
Cleaning up... 
No distributions matching the version for django-endless-pagination==1.1 

我需要做些什麼才能重新使用它?升級我的應用程序以使用所有軟件包的所有最新版本是不可能的。

更新: 這在pip 1.4.1中正常工作。這是更新版本的pip,導致它失敗。

+1

按照消息的建議嘗試'--allow-external'。 –

+0

有關此問題的進一步討論,請訪問:https://github.com/pypa/pip/issues/1423 – LS55321

+0

--allow-external會失敗,並顯示不同的錯誤,說明您需要添加--allow-unvalidate,這也會導致失敗消息'您必須至少提供一個安裝要求' – LS55321

回答

2

在這種情況下,您可以使用相應的zip文件作爲輸入的URL pip install ::

pip install https://github.com/frankban/django-endless-pagination/archive/v1.1.zip 

當然,不是每個包都會有這樣一個URL可用,但大多數人。

我偶爾會用它來安裝最新最棒的主人,因爲在某些情況下,奶酪店還沒有Python 3準備好的軟件包。

0

由於PyPI上的版本是2.0,現在pip試圖維護維護人員希望您使用給定版本的事實。

4

PIP 1.5 changelog

不向後兼容

PIP將不再刮默認不安全的外部URL,也不會安裝外部由 默認託管文件。用戶可以選擇到使用--allow-external PROJECT--allow-unverified PROJECT

安裝外部託管或不安全 文件或網址,以便在這種情況下,下面應該以同樣的方式工作,爲老PIP:

pip install django-endless-pagination==1.1 \ 
--allow-all-external --allow-unverified django-endless-pagination 

(有no --allow-all-unverified,每個未驗證的項目名稱必須指定)

在使用requirements.txt的情況下,應該如下指定:

--allow-external django-endless-pagination 
--allow-unverified django-endless-pagination 

django-endless-pagination==1.1 
+0

這仍然失敗,並顯示消息說要添加 - 允許未驗證,並且添加失敗 – LS55321

+0

@LeeSemel:已更新,HTH – vartec

+0

因此,需要爲每個requirements.txt中的每個包現在?似乎堅果,他們必須列出三次。 – LS55321