cythonized modules in zipapp (.pyz) cant be imported
See original GitHub issueI’ve a module cythonized in mydir.
Running python3 mydir/__main__.py
works fine, but if I create a .pyz
with zipapp but after that python3 mydir.pyz fail with message
ImportError.
Traceback (most recent call last):
File "/usr/local/lib/python3.5/runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "/usr/local/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "machine.pyz/__main__.py", line 5, in <module>
ImportError: No module named 'ads.main'
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
ImportError: Cannot import Cython module - Stack Overflow
I found my mistake. After trying a million things, I figured it has nothing to do with my setup.py or my source code....
Read more >zipapp — Manage executable Python zip archives — Python ...
The main argument should take the form “pkg.module:callable” and the archive will be run by importing “pkg.module” and executing the given callable with...
Read more >zipapps - PyPI
Distribute zipapp with embedded python. Use as a requirements zip path, or some venv usages. import sys;sys.path.insert(0, 'app.pyz') ...
Read more >Release notes for Python 3.5.4
bpo-23491: Added a zipapp module to support creating executable zip file archives of Python code. Registered ".pyz" and ".pyzw" extensions on Windows for ......
Read more >Importing a cython module from another module
so for each file with success, but I cannot import/link bitarray (it is a C extension itself, the module has a __init__.py and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is not a restriction with Cython, but with zipimport, and any fix would have to be on that side.
zipapp merely leverages Python’s built-in
zipimport
facility; from the zipimport docs we find: