2

I have multiple versions of Python installed(2.5,2.7). I am using Ubuntu. Python2.7 is my default Python interpreter. So all packages like PIL is installed in python2.7. Now i want to install some packages in Python 2.5 version. I need to install Pip so that i could install the packages. Now i do understand some would give the advice of virtualenv. I tried that too. But installing Pil through that too doesn't show the packages in the python2.5 version. It installs it in python2.7 version. So i need to do something so that when pip installs the package it installs it in Python2.5 version. Any suggestions?

I also tried this:

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

but it says no module named pip

Aarushi
  • 544
  • 1
  • 5
  • 15

1 Answers1

1

According to this answer: pip: dealing with multiple Python versions?

You have to try like this if pip >= 1.5:

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

Else:

$ pip-2.5 install SomePackage  
$ pip-2.7 install SomePackage  
Community
  • 1
  • 1
ruddra
  • 50,746
  • 7
  • 78
  • 101
  • I tried that. It worked but i wasn't able to get the package to properly work. I wanted to install PIL or Pillow. – Aarushi Jul 21 '14 at 15:58
  • The _imagingft C module is not installed. I was able to find the unofficial libraries for windows and it contained the right package but for ubunutu, there aren't any. – Aarushi Jul 21 '14 at 16:37
  • did you install `apt-get install libjpeg-dev` `apt-get install libfreetype6-dev` `apt-get install zlib1g-dev` `apt-get install libpng12-dev` ??? – ruddra Jul 21 '14 at 16:48
  • I did, but they are installed for the default python version only i guess. I need it working for 2.5. All of the above packages are installed. – Aarushi Jul 21 '14 at 17:15
  • As I checked, Pillow < 2.0.0 is supported in Python2.5, so can you try: `pip-2.5 install Pillow==1.7.8` ? – ruddra Jul 21 '14 at 17:19
  • I tried that too, installing Pillow gives other error like missing freetype/fterrors.h – Aarushi Jul 21 '14 at 17:26
  • I am not sure about this suggestion, if you are open for testing, I will suggest you something I am not sure will work or not. download pillow for python(64/32 bit doesn't matter) 2.5 from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil, extract exe, from PURELIB folder of that extracted file, copy and paste `PIL, pillow-egginfo folder` to your python25/.../sitepackages folder. check what happens.(I know its windows distribution, but those are compiled files) – ruddra Jul 21 '14 at 17:47
  • 1
    That is a clever advice but the .egg file will be containing windows somewhere in it which can cause an error. Though i will surely give it a try. Thank you for your patience, time and help. – Aarushi Jul 21 '14 at 18:09