From: <my....@gm...> - 2017-06-18 12:49:29
|
Following my topic, I'm looking help here on this list. https://stackoverflow.com/questions/44606422/python34-pyqt5-mvc-and-py2exe-zipextimporter-py-line-116-in-load-module-c 1.. I have Python34 MVC app that working corect in typical python execution as script that including all modules from MVC for PyQt5. https://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.5.1/ 2.. When I using py2exe (no any errors - Copy DLL to dst), then app.exe is created,but not executed coz exist error: Traceback (most recent call last): File "main.pyw", line 6, in <module> File "E:Python34\lib\site-packages\zipextimporter.py", line 116, in load_module raise zipimport.ZipImportError("can't find module %s" % fullname) zipimport.ZipImportError: can't find module Controller.MainController There is thousend queries by google with similar error logs, but not any ansewer how to resolve by own, with full understandig of this issue (eg debug). The app looks like: import sys from PyQt5.QtWidgets import QApplication, QMessageBox from PyQt5 import QtCore, QtGui from Model.MainModel import MainModelClass from Controller.MainController import MainControllerClass def main(): app = QApplication( sys.argv ) model = MainModelClass() controller = MainControllerClass(model) app.exec_() if __name__ == '__main__': sys.exit(main()) 3.. What I discover time ago and was suprised, that py2exe expect init.py on each folder where is module for MVC (that is not required on pure python execution). In other way if not init then bug as in point 2 is permament (I have other version of app that just not need more libs eg. QDialog in MainView and working ok, but if init.py is deleted from folder Contoroller where is MainContoroller.py then as in point 2 if init.py exist then compiled .exe is ok and working as expect. I'm sure that init.py is everywhere. 4.. How to prevent this? How to discover the point in code for this .exe from py2exe as problem or extort module Controller.MainController? 5.. Any similar issues with py2exe and solutions to repair? 6.. It's work in pure python and pyinstaler compiller coretly. But I'm not happy from pyinstaler in case that in some of my aps have many .pyd files, which can't be inside .exe and this case creating chaos in folder app. as _MEI or other, exist additional includes, plugins, etc.. Soo function of use py2exe is comfy, specialy if I operate on some universal framework for app, eg. usefull staff as esky,etc. And this post is for reach more knoweledge about py2exe or some problems. Maybe I'm too long this problem and missed something very simply or not doing this right way (checking source of problem - eg. dependecy walker?). Hi, |