Nuitka: Nuitka doesn't work with trio.
I’m using Nuitka 0.6.3.1 and Python 3.6.5 in a venv environment on a linux machine. I installed Nuitka and trio with command:
pip install Nuitka trio
trio is an async library. https://github.com/python-trio/trio
I have a file t.py like this:
import trio
async def main():
print('hello')
trio.run(main)
If I run the script directly, everything is fine.
$ python t.py
hello
But if I compile the script with Nuitka, it doesn’t run anymore
$ python -m nuitka t.py
Nuitka:WARNING:Not recursing to 'trio' (/home/leojay/test/py3test/lib/python3.6/site-packages/trio), please specify --nofollow-imports (do not warn), --follow-imports (recurse to all), --nofollow-import-to=trio (ignore it), --follow-import-to=trio (recurse to it) to change.
$ ./t.bin
Traceback (most recent call last):
File "/home/leojay/test/py3test/t.py", line 6, in <module>
trio.run(main)
File "/home/leojay/test/py3test/lib/python3.6/site-packages/trio/_core/_run.py", line 1430, in run
run_impl(runner, async_fn, args)
File "/home/leojay/test/py3test/lib/python3.6/site-packages/trio/_core/_run.py", line 1579, in run_impl
runner.task_exited(task, final_outcome)
File "/home/leojay/test/py3test/lib/python3.6/site-packages/trio/_core/_run.py", line 1064, in task_exited
raise TrioInternalError
trio.TrioInternalError
I expect the script to output hello, instead of throwing an exception.
Can you please take a look at this?
Thanks!
Leo
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 25 (24 by maintainers)
Hi,
I managed to reproduce the second problem with relatively simple code. Here is my code structure:
Here are the contents of all files:
When running the code directly, everything is fine:
But when running the compiled code, it shows an import error:
Hope this helps.
Leo