How to share 3rd-party modules between 2.2 and 2.3?

M

Matthew Wilson

I have Red Hat 9 installed, which uses python2.2 for lots of system
tasks. I also installed 2.3 using the rpms available from python.org.

I want to write some CGI scripts that use pgdb. I want to write the
python scripts using python2.3, but the pgdb.py file is in

/usr/lib/python2.2/site-packages

which is not part of sys.path in python2.3. What is the best way of
sharing these modules?

I don't want to add /usr/lib/python2.2/site-packages to my $PYTHONPATH
variable because the apache user doesn't get a log in.

I thought about adding a symbolic link to
/usr/lib/python2.3/site-packages for every file in
/usr/lib/python2.2/site-packages.

Does anyone have a better idea?
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Matthew said:
I want to write some CGI scripts that use pgdb. I want to write the
python scripts using python2.3, but the pgdb.py file is in

/usr/lib/python2.2/site-packages

which is not part of sys.path in python2.3. What is the best way of
sharing these modules?

Put the code in /usr/lib/site-python.

Regards,
Martin
 
?

=?ISO-8859-1?Q?Gerhard_H=E4ring?=

Martin said:
Put the code in /usr/lib/site-python.

I suppose pgdb.py is from PyGreSQL, which includes a C extension module. Sharing
extension modules between different Python minor versions *might* work, but it's
best to just install the package in question for both Python 2.2 and 2.3.

-- Gerhard
 
M

Michael Hudson

Matthew Wilson said:
I have Red Hat 9 installed, which uses python2.2 for lots of system
tasks. I also installed 2.3 using the rpms available from python.org.

I want to write some CGI scripts that use pgdb. I want to write the
python scripts using python2.3, but the pgdb.py file is in

/usr/lib/python2.2/site-packages

which is not part of sys.path in python2.3. What is the best way of
sharing these modules?

I'd recommend against it. The bytecode is different between 2.2 and
2.3, so the .pycs alongside the source files will only be useful for
one install. And while binary compatibility of C extensions is fairly
likely, it's not total.
Does anyone have a better idea?

Just install pgdb again.

Cheers,
mwh
 

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

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top