Hi,
the faq I read so many times and also the  manule too. 
I post the sample code because it's my original code and it runs OK not using 
pyinstaller . Why I use "for loop " to load_source is because there are so many 
.py
 Files which need to import and may increase in the future. 
First, I use the --onefile mode and it fails to add the .py files ,and I try to 
add this as collect data files into pyz ,it' ok. but load_source run failed.
Then I chang my mind to modify my original code. If I can hidden import the 
module,I don' need to add the original .py files in PYZ,just hidden import it 
and use find_module() to get the module instance and my code can run without so 
many change.but hidden import can't take effect in release version,using 
development version the hidden import is OK but I faced another error like 
sqlite3 can not find.

After many tries
I finally resolved this problem today by using so many explicitly import 
sentence in the main entry code and the release version 1.5.1 can recognize all 
the modules using sys.modules, and I filter the sys.modules to get all the 
modules within app/controllers. I don't need any find_module() then.
Now the executable produced by release version 1.5.1 with -onefile mode runs 
successfuly. But I still not know how the import things work with py installer.
Anyway, pyinstaller is a very usefull tool to package and release our python 
project because it can run independently in the product enviorment, we don't 
have to consider about the different python enviorment our app runs.
Thanks for your reply.

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/pyinstaller/-/1jFiysPdx_0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyinstaller?hl=en.

Reply via email to