471,337 Members | 1,164 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

compiling an extension for several versions of python

mh
I don't have access to site-packages, but I would like
to provide versions of my c-language package compiled against
python 2.4 and 2.5.

I "own" a library directory which is included in our site's
sys.path. Currently this is where the 2.4 shared libary
is installed.

What's the most canonical way of doing this? This is on linux.

Many TIA!
Mark

--
Mark Harrison
Pixar Animation Studios
Sep 12 '07 #1
1 923
mh@pixar.com wrote:
I don't have access to site-packages, but I would like
to provide versions of my c-language package compiled against
python 2.4 and 2.5.

I "own" a library directory which is included in our site's
sys.path. Currently this is where the 2.4 shared libary
is installed.

What's the most canonical way of doing this? This is on linux.

Many TIA!
Mark
Normally, you would make 2 different distros which people could
download, etc. But in this setting, if I get your meaning correctly,
your best bet would be to wrap them in another module and let people
import the wrapper module. The wrapper module would then use one the
following calls to decide which version of your package to import:

pyimport sys
pysys.version
'2.5 (r25:51908, Oct 10 2006, 03:45:47) \n[GCC 4.0.1 (Apple Computer,
Inc. build 5363)]'
pysys.version_info
(2, 5, 0, 'final', 0)

James
Sep 12 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.