2017-05-31 87 views
1

我剛剛安裝了一堆軟件包,在python上使用MySQL,但我不確定哪一種方法可以實現(無論哪種方法,只能在重新啓動後才能使用)。無法安裝凍結

現在我試圖在virtualenv上使用它,所以我在本地機器上用pip凍結創建了一個requirements.txt,然後我創建了一個virtualenv並嘗試了pip install -r requirements.txt。但是,不能安裝任何軟件包,而錯誤是:

Could not find a version that satisfies the requirement mysql-connector-python<=2.0.4 (from -r myvi/requirements.txt (line 1)) (from versions:) 
No matching distribution found for mysql-connector-python<=2.0.4 (from -r myvi/requirements.txt (line 1)) 

嘗試手動編輯的文件,但無論第一線,總是報同樣的錯誤。

使用Google搜索該主題,我只發現特定於包的解決方案,但無論包裝如何,我都會收到錯誤。這是爲什麼發生?

編輯:我認爲所有的軟件包都引發錯誤,但只有一些是。即:

adium-theme-ubuntu==0.3.4 
mysql-connector-python==2.0.4 
Pyste==0.9.10 
unity-lens-photos==1.0 

我想,如果它是由pip freeze建成,這將有可能pip install它。

+0

你能告訴我們你的需求文件的內容嗎? (只是幾行) –

+0

試試這個https://stackoverflow.com/questions/34489271/i-cannot-install-mysql-connector-python-using-pip – tom

+0

'adium-theme-ubuntu == 0.3.4 cycler == 0.10.0 mysql-connector-python == 2.0.4' (...) –

回答

1

我不知道你是怎麼之前安裝mysql-connector-python,但its PyPI page沒有列出任何可下載的文件,其任何版本的,所以你不能用PIP(安裝至少,不是一個普通的pip install mysql-connector-python==2.0.4或喜歡)。嘗試刪除requirements.txt文件中的mysql-connector-python行。

你提到的其他包(adium-theme-ubuntuPysteunity-lens-photos)甚至不存在PyPI上,所以pip install絕對不會爲他們工作。

+0

並不是所有來自pip freeze的軟件包都可以通過pip instal安裝,其中包含一個錯誤。添加到你的答案,我會接受它。 –