Vincent Le Goff
unread,Mar 22, 2020, 1:41:03 PM3/22/20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pyins...@googlegroups.com
Hello all,
Still using PyInstaller and trying to find solutions whenever I stumble
across a bug. Right now I have a question: I'm using a library
(tortoise-orm) which analyzes code in order to find models. The code
works when Python isn't frozen, but if PyInstaller is asked to freeze
it, an error will occur when trying to process the user code:
source = inspect.getsource(cls)
This will raise an OSError. The source code can't be found, which
stands to reason as I believe PyInstaller will only store compiled
bytecodes (which might have lost the ability to be analyzed like this).
Does anyone think of a solution?
Ugly fix: remove tortoise from the hiddenimports and add the entire
tortoise source code right at the root of my project, to force the
executable to use the non-frozen tortoise source code. Dependencies of
tortoise will need to be added in the hiddenimports and this is
definitely not a great solution, so anything better would be great.
Thanks in advance,
Vincent