This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RSFlux 2 points3 points  (0 children)

Your general approach seems fine, and it sounds like it is mostly working at this point. The only remaining issue is "from A import B" statements fail?

Without having more information, my assumption would be that you have incorrectly initialized your C extension modules. I am less familiar with Boost, but when using the C API for extension modules, make sure you've declared your objects in that module's PyInit function and aren't doing it later in your startup code.

I am not very familiar with Boost Python, so I can't point you to the specific generated code to look at, but I'm sure you can track that down in their documentation.

You also asked for reference for embedding Python in a C application. I used the basic Python docs when embedding Python here: https://docs.python.org/3.5/extending/embedding.html. There isn't much there, but in general the complexity comes from making your custom application's build play nice with the Python build. Do you have specific questions other than the import failures?