Skip to content

python file can't import module after change pybind target name #61

@argentea

Description

@argentea

I move the test_basic.py to project root directory and change the import path.
Then, I change the target name in CMakeLists.txt and module name in test_basic.py.
Then, "mkdir build; cd build; cmake ...; make", and everything goes well.
However, when i run the test_basic.py, I get
"Traceback (most recent call last):
File "test_basic.py", line 2, in
import build.bind_example as m
ImportError: dynamic module does not define module export function (PyInit_bind_example)
".

Besides, when I change the target name back to cmake_example, the python file import module normally,

Attached files is the version which target name is changed.
CMakeLists.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions