Using autowrap to build a D library for Python

tastyminerals tastyminerals at gmail.com
Tue Jun 16 21:34:39 UTC 2020


I am trying out autowrap to build a D library for Python.

After I ran "dub build" which builds mylib.so and try to import 
it in Python interpreter, I get:

"ImportError: dynamic module does not define module export 
function (PyInit_libautowrap_mylib)"

Which means the library was build for some other Python version 
which is strange because in dub.sdl I specifically set

subConfiguration "autowrap:python" "python36"

And attempt to import the libautowrap_mylib from Python 3.6.9 
interpreter.

The dub.sdl contains the following deps:

dependency "autowrap:python" version="~>0.5.2"
dependency "mylib" version="~>1.0.0"
subConfiguration "autowrap:python" "python36"
targetType "dynamicLibrary"






More information about the Digitalmars-d-learn mailing list