Installing a second version of an existing package

D

Derek Fountain

Is it possible to install a second version of an existing package? My SUSE
Linux box has PIL-1.1.3 installed, and this is used by the OS for various
tasks. It's bundled as part of a "python-imaging" package, which includes
tkinter and other stuff. Removing it causes widespread damage!

I want to install PIL-1.1.4, since I need the EXIF stuff. Is it possible to
install PIL-1.1.4 alongside PIL-1.1.3? If so, how do I go about it, and how
do I ensure my script runs the version of the library I want?
 
F

Fredrik Lundh

Derek said:
Is it possible to install a second version of an existing package? My SUSE
Linux box has PIL-1.1.3 installed, and this is used by the OS for various
tasks. It's bundled as part of a "python-imaging" package, which includes
tkinter and other stuff. Removing it causes widespread damage!

I want to install PIL-1.1.4, since I need the EXIF stuff. Is it possible to
install PIL-1.1.4 alongside PIL-1.1.3? If so, how do I go about it, and how
do I ensure my script runs the version of the library I want?

keeping the PIL PY files in a separate directory is trivial (just build PIL
as usual, and put the PIL/*.py stuff in, say, site-packages/PIL114),
but preventing 1.1.4 from picking up the binary files for 1.1.3 might
be harder.

on the other hand, I'm pretty sure that 1.1.4's JpegImagePlugin.py file
works with 1.1.3's binaries. in other words, this might work:

1) make a backup copy of the 1.1.3 installation directory
2) copy 1.1.4's JpegImagePlugin.py to the 1.1.3 installation directory
3) copy 1.1.4's ExifTags.py to the 1.1.3 installation directory
4) ????
5) profit!

</F>
 
D

Derek Fountain

keeping the PIL PY files in a separate directory is trivial (just build
PIL as usual, and put the PIL/*.py stuff in, say, site-packages/PIL114),
but preventing 1.1.4 from picking up the binary files for 1.1.3 might
be harder.

I built it as normal, then renamed the PIL directory in the build tree to
PIL114, then tweaked the installation to copy that directory instead of the
original PIL one. The two now exist side by side in the libraries tree.

Python picks up PIL before PIL114, which is good, since the OS is based
around PIL. For my script I used a hack: I just removed the PIL directory
from sys.path before the import so it finds modules in PIL114. :eek:) That's
not a long term solution but it'll do for now.
 
P

Paul Clinch

Derek Fountain said:
Is it possible to install a second version of an existing package? My SUSE
Linux box has PIL-1.1.3 installed, and this is used by the OS for various
tasks. It's bundled as part of a "python-imaging" package, which includes
tkinter and other stuff. Removing it causes widespread damage!

My suse is version 8.2, I used yast to check dependencies prior to removing
it, which reported only sketch requires python-imaging. You may have other
packages installed, but they're hardly the OS.
I want to install PIL-1.1.4, since I need the EXIF stuff. Is it possible to
install PIL-1.1.4 alongside PIL-1.1.3? If so, how do I go about it, and how
do I ensure my script runs the version of the library I want?

I'm not familiar with PIL, but usually packages numbered using this form are
upwardly compatible when the last digit, ie. minor version number changes.
So you may be able to able to ignore a warnings from the installer. Its easy to
back up the site-packages/PIL directory prior to doing this, just in case.

If it turns out that the different versions aren't compatible, you'll have to:-
a) rename the new directory site-packages/PIL4 and change your import
statement or,
b) install a different version of python, eg. 2.3 then install the .4 PIL into
that site-packages directory.

Hope this makes sense, Paul Clinch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,919
Members
47,459
Latest member
Vida00R129

Latest Threads

Top