November 13, 2006

  • Python 2.5 and SWIG 1.3.30

    After hours of frustration, I figured out how to build C++ DLLs and link them into scripts for the latest version of Python (2.5).


    The idea is that you may have developed some C++ code that you would like to be able to import into Python.  There’s a really cool wrapper program called SWIG that helps you do just this.  But with all of the latest updates to Python, SWIG broke, and so did the graphing library I was trying to use.


    In short, if you are getting errors like:



    ImportError: No module named _pymfg


    (Your module name in place of _pymfg)


    There are two things you should know.



    1. You may need to recompile your DLL using SWIG 1.3.30.  Prior versions are incompatible with Python 2.5.

    2. You must to rename your DLL to PYD.

    If you’re looking for a compiled version of the mfgraph library for Python 2.5, let me know.

Comments (11)

Post a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *