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

ImportError: dynamic module does not define init function #1284

Closed
honggyukim opened this issue Jul 17, 2021 · 1 comment
Closed

ImportError: dynamic module does not define init function #1284

honggyukim opened this issue Jul 17, 2021 · 1 comment
Labels

Comments

@honggyukim
Copy link
Collaborator

For some reasons, we can't run script command as follows.

$ uftrace record t-abc

$ uftrace script -S scripts/simple.py
ImportError: dynamic module does not define module export function (PyInit_simple)
WARN: "scripts/simple.py" cannot be imported!
WARN: failed to init python scripting

Here is with the output with debug messages.

$ uftrace script -S scripts/simple.py --debug-domain script:3
script: script_init("scripts/simple.py")
script: script_init_for_python("scripts/simple.py")
script: libpython3.8.so is loaded
script: set_python_path("scripts/simple.py")
ImportError: dynamic module does not define module export function (PyInit_simple)
WARN: "scripts/simple.py" cannot be imported!
WARN: failed to init python scripting
script: script_finish()
script: script_finish_for_python()
@honggyukim honggyukim added the bug label Jul 17, 2021
@honggyukim
Copy link
Collaborator Author

This problem happens because my scripts directory also has simple.so that is compiled when developing #1205.

It works fine after removing all the .so files that have the same name as .py files under scripts directory. I hope there is a way to import a .py module over the .so module with the same name.

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

No branches or pull requests

1 participant