site-packages versus site-python

enrio at online.no enrio at online.no
Sat Mar 5 16:28:08 CET 2005


I recently installed python 2.4, and many installed software packages
stopped working. Some things got working after I copied some files and
directories from /usr/lib/python2.3/site-packages to
/usr/lib/python2.4/site-packages, but I also had to install a newer
PyXml package, as some of the files that came with python2.4 required a
newer version of pyxml than I had in python2.3/site-packages.

I wonder if there is any particular reason I have no
/usr/lib/site-python directory, and everything is installed in
version-specific site-packages.

I have Fedora Core 3. Is it the Fedora packagers who prefer installing
everything in the version-specific directory? Is there no way to have
older packages continue working in the presence of python2.4? (I still
want the newest to be the default!)

I have tried (cd /usr/bin; grep '#!.*python' * 2>/dev/null), and very
few of the programs have a specific version in the interpreter line. Is
there any good reason this is so?

Thinking about it, a particular python program may require a particular
module, but not any particular version of python or the module. The
module perhaps requires at least python2.3, but could run just as well
with python2.4 or later. It does not make sense to have the program
demand a particular version of python in its interpreter string (e.g.,
"#!/usr/bin/python2.3"), but what about the module. Would it be better
to put the module in site-python and include code to check the
interpreter version?

Perhaps there is no perfect solution that covers all permutations, but
on the other hand, what is currently the "correct philosophy" of
version handling?




More information about the Python-list mailing list