Distributing compiled (swig) python modules

Discussion in 'Python' started by mathieu, Oct 15, 2008.

  1. mathieu

    mathieu Guest

    Hi there,

    I have prepared binaries of a python module that I wrote. Basically
    the lib is written in C++ and wrapped in python using SWIG. Of course
    it links to the python dynamic libraries. I found out that this is
    version dependant. For instance if I prepare the binaries on my
    machine with a python 2.4 installation this module will not load
    properly on a python 2.5 / 2.6 installation.

    Is there some documentation (that I missed in my previous google
    search) that describe how to prepare python module that can be
    redistributed with some kind of backward compatibility (= so that when
    prepared on python 2.4, it works on 2.5/2.6 at least) ?

    Thanks
    mathieu, Oct 15, 2008
    #1
    1. Advertising

  2. mathieu wrote:

    > Hi there,
    >
    > I have prepared binaries of a python module that I wrote. Basically
    > the lib is written in C++ and wrapped in python using SWIG. Of course
    > it links to the python dynamic libraries. I found out that this is
    > version dependant. For instance if I prepare the binaries on my
    > machine with a python 2.4 installation this module will not load
    > properly on a python 2.5 / 2.6 installation.
    >
    > Is there some documentation (that I missed in my previous google
    > search) that describe how to prepare python module that can be
    > redistributed with some kind of backward compatibility (= so that when
    > prepared on python 2.4, it works on 2.5/2.6 at least) ?


    There is no such way, and can't be because of C-API-changes in python.dlls.
    You will have to offer your library separately for each python version you
    support.

    I don't know too much about SWIG, but if you can make your whole
    build-process based on distutils or setuptools, you should be able to
    produce eggs to install that your users then can install very easy.

    Diez
    Diez B. Roggisch, Oct 15, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jiri Barton

    Distributing closed source modules

    Jiri Barton, Mar 24, 2005, in forum: Python
    Replies:
    5
    Views:
    377
    Dave Brueck
    Mar 29, 2005
  2. r1pp3r
    Replies:
    1
    Views:
    258
    Fredrik Lundh
    Aug 29, 2006
  3. Tina I
    Replies:
    11
    Views:
    410
    Tina I
    May 17, 2007
  4. eliben
    Replies:
    9
    Views:
    342
    eliben
    Jun 9, 2008
  5. mathieu
    Replies:
    1
    Views:
    264
    Diez B. Roggisch
    Jun 4, 2008
Loading...

Share This Page