473,320 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 960
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jon Nicoll | last post by:
Hi all anyone know what compiler and version I should use to compile an extension module for ActiveState Python 2.3? <background> quite a few years ago I used a useful Python extension module...
6
by: Martin Bless | last post by:
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME C++ compiler and linker Python is built with...
0
by: Neal Norwitz | last post by:
If you don't write or otherwise maintain Python Extension Modules written in C (or C++) or embed Python in your application, you can stop reading. Python 2.5 alpha 1 was released April 5, 2006. ...
0
by: follower | last post by:
This post is mostly Google-bait for anyone else that might want to compile SpiderMonkey ( libjs / libjs.so / libjs.dylib ) for OS X (10.4.5 in my case) and then use it with Python's ctypes. I can't...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.