Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
argentea opened this issue Sep 28, 2021 · 0 comments
Open

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

argentea opened this issue Sep 28, 2021 · 0 comments

Comments

@argentea
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant