Skip to content Skip to sidebar Skip to footer

"no Module Named '_'" When Importing A Swig Module With Embedded Python

I'm trying to use SWIG with embedded Python 3.5.2. The following is built as a Windows console app. It fails initializing the Python side SWIG module 'arpy.py' when it tries to imp

Solution 1:

From the examples here: (https://docs.python.org/3/extending/embedding.html) I see that to import the SWIG C++ module as a builtin you need:

PyImport_AppendInittab("_arpy", &PyInit__arpy);

before calling Py_Initialize()

Things work as expected now.

Post a Comment for ""no Module Named '_'" When Importing A Swig Module With Embedded Python"