Even if a module is in the stdlib, it might not be included if it is not
referenced somewhere (pyinstaller attempts to make the resulting binary as
small as possible by only including what is needed).  That appears to be
the case here, so '--hidden-import' is a likely solution.  Try

pyinstaller --hidden-import traceback entrypoint.py

and see if that gets you any farther...

Eric

On Wed, Mar 15, 2023 at 3:31 AM Xavier Nunn <xavier.n...@sandboxquantum.com>
wrote:

> Hello!
>
> I have been trying to compile a python application into a binary using
> pyinstaller. The result seems to compile just fine, there are no error
> messages during compilation. However, when running the resulting binary I
> get:
>
> (...)
>   File "PyInstaller/loader/pyimod02_importers.py", line 352, in exec_module
>   File "cli/cli.py", line 5, in <module>
>   File "PyInstaller/loader/pyimod02_importers.py", line 352, in exec_module
>   File "cli/main.py", line 9, in <module>
>   File "PyInstaller/loader/pyimod02_importers.py", line 352, in exec_module
>   File "anyio/__init__.py", line 89, in <module>
>   File "PyInstaller/loader/pyimod02_importers.py", line 352, in exec_module
>   File "anyio/_core/_exceptions.py", line 1, in <module>
> ModuleNotFoundError: No module named 'traceback'
>
> I don't understand how this can happen, since traceback is part of the
> standard library? I have even tried a version where I remove references to
> traceback in anyio (by editing the locally downloaded code) but I just get
> the same error in another place where traceback gets imported.
>
> The compilation command I run has absolutely no extra options set, just:
> pyinstaller entrypoint.py
>
> I am lost here. Any pointers on how I could debug this?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/f5d71120-bb21-453c-9913-e4d4cb6b566dn%40googlegroups.com
> <https://groups.google.com/d/msgid/pyinstaller/f5d71120-bb21-453c-9913-e4d4cb6b566dn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CAP2Qz%2BUhxR_BFf3ThfBOiuwbUM8k4KSr7OkaYeB7%3DtuD0kiu1w%40mail.gmail.com.

Reply via email to