SWIG/Python2.4.1: "ImportError: dynamic module does not define init function (initSHIP)"

Bill Davy Bill at SynectixLtd.com
Wed May 4 09:43:59 EDT 2005


Hello,

I am using SWIG-1.3.24 to make an extension (called SHIP) to Python2.4.1 and 
then running under IDLE (if that makes any difference) but when I "import 
SHIP" I get:

>>> import SHIP

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in -toplevel-
    import SHIP
ImportError: dynamic module does not define init function (initSHIP)
>>>

Indeed, SHIP.py does not define an initSHIP.  It does have "import _SHIP"

SHIP_wrap.cpp (produced by SWIG) does have init_SHIP (defined to SWIG_init).

It seems to me I should not be editing SHIP.py (as made by SWIG) but it does 
seem to be missing something, or am I?

Thanks in advance,

   Bill

PS I gave up trying to use IDLE with a locally compiled debug version of 
Python - that's for another day (or week), but thanks for the assorted help 
I was given. 





More information about the Python-list mailing list