2014-07-15 73 views
2

我安裝了多個版本的Python(2.5,2.7)。我正在使用Ubuntu。 Python2.7是我的默認Python解釋器。所以像PIL這樣的所有軟件包都安裝在python2.7中。現在我想在Python 2.5版本中安裝一些軟件包。 我需要安裝PIP才能安裝軟件包。現在我明白一些人會給出virtualenv的建議。我也嘗試過。 但是,通過它安裝Pil也不會顯示python2.5版本中的軟件包。它安裝在python2.7版本中。所以我需要做一些事情,以便在pip安裝包時將它安裝在Python2.5版本中。有什麼建議麼?在不同版本的python中安裝pip

我也試過這樣:

python2 -m pip install SomePackage # default Python 2 
python2.5 -m pip install SomePackage # specifically Python 2.5 

,但它說沒有模塊名爲PIP

回答

1

根據這樣的回答:pip: dealing with multiple Python versions?

你一定要試試這樣如果PIP> = 1.5:

$ pip2.5 install SomePackage 
$ pip2.7 install SomePackage 

其他:

$ pip-2.5 install SomePackage 
$ pip-2.7 install SomePackage 
+0

我試過了。它的工作,但我無法讓包正常工作。我想安裝PIL或Pillow。 –

+0

你得到了什麼錯誤? – ruddra

+0

未安裝_imagingft C模塊。我能夠找到窗口的非官方圖書館,它包含正確的包,但對於ubunutu,沒有任何。 –