views:

211

answers:

2

I am supporting an application with a hard dependency on python-devel 2.3.7. The application runs the python interpreter embedded, attempting to load libpython2.3.so - but since the local machine has libpython2.4.so under /usr/lib64, the application is failing.

I see that there are RPMs for python-devel (but not version 2.3.x). Another wrinkle is that I don't want to overwrite the existing python under /usr/lib (I don't have su anyway). What I want to do is place the somewhere in my home directory (i.e. /home/noahz/lib) and use PATH and LD_LIBRARY_PATH to point to the older version for this application.

What I'm trying to find out (but can't seem to craft the right google search for) is:

1) Where do I download python-devel-2.3 or libpython2.3.so.1.0 (if either available)

2a) If I can't download python-devel-2.3, how do I build libpython2.3.so from source (already downloaded Python-2.3.tgz and

2b) Is building libpython2.3.so.1.0 from source and pointing to it with LD_LIBRARY_PATH good enough, or am I going to run into other problems (other dependencies)

3) In general, am I approaching this problem the right way?

ADDITIONAL INFO:

  • I attempted to symlink (ln -s) to the later version. This caused the app to fail silently.

  • Distro is Red Hat Enterprise Linux 5 (RHEL5) - for x86_64

+1  A: 

You can use the python RPM's linked to from the python home page ChristopheD mentioned. You can extract the RPM's using cpio, as they are just specialized cpio archives. Your method of extracting them to your home directory and setting LD_LIBRARY_PATH and PATH should work; I use this all the time for hand-built newer versions of projects I also have installed.

Don't focus on the -devel package though; you need the main package. You can unpack the -devel one as well, but the only thing you'll actually use from it is the libpython2.3.so symlink that points to the actual library, and you can just as well create this by hand.

Whether this is the right approach depends on what you are trying to do. If all you're trying to do is to get this one application to run for you personally, then this hack sounds fine.

If you wanted to actually distribute something to other people for running this application, and you have no way of fixing the actual application, you should consider building an rpm of the older python version that doesn't conflict with the system-installed one.

Thomas Vander Stichele
googled for "how to make libpython2.3.so" (no quotes) - this page was the first hit: http://www.czaplinski.net/sun/#python - it worked. Thanks!
noahz