2006/5/30, Oded Arbel <[EMAIL PROTECTED]>:
Problem: what I want to install eventually requires me to upgrade python from the CentOS version (2.3) to the Fedora Core 4 version (2.4), and due to this it needs to upgrade a python component called python-elementtree, as it requires a specific python ABI version.
Side note (only helps you if you want to bypass official package management): Many Python libraries, including python-elementtree, are pure-python libraries and should work unchanged with any python version that they support [1]_. Copying /usr/lib/python2.3/site-packages/elementtree to /usr/lib/python2.4/site-packages/ should work. The only thing that you may call an ABI are the byte-compiled .pyc files. python2.4 will ignore byte-code files from 2.3 and will work a bit slower. Running as root "python2.4 -c 'import elementtree'" should [2]_ byte-compile all files in /usr/lib/python2.4/site-packages/elementtree/. Some Python libraries (like python-celementtree, note the "c") do wrap C code and must be linked to the correct libpython, so you really have to get the right package or build from source. If you don't care about the byte-code files, you can just put pure-python libs in /usr/lib/site-python/, where all python versions will find it. . [1] Python is evolving, so every package is maintained against "Python X or later", where X tends nowdays to be 2.2 or even 2.3. "or later" is correct for any actively maintained library -- unmaintained code usualy breaks after several major versions of Python (after a transition period with warnings). . [2] Unless the package does lazy / conditional imports. To be sure you want to import every module in the package. And if you really care, repeat the with -O to produce the .pyo files used when python is run with -O (never?). What you really want to do in case of doubt is to get the source and run "python2.4 ./setup.py build" (and perhaps "sudo python2.4 ./setup.py install"). This also builds and links C extensions if any -- it's very easy to use. Of course, I've used 2.3/2.4 and elementtree as examples; what I said applies to most Python libraries. -- Beni Cherniavsky <[EMAIL PROTECTED]>, who can only read email on weekends. Fedora refugee => happy Debian user (hint hint :-) ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
