[PyQt] pyqtdeployed app crashes on launch

Dave Gradwell davegradwell at yahoo.co.uk
Sun Jul 27 00:27:55 BST 2014


Well I moved to PyQt5 but am back to my previous problem of imports failing in the pyqtdeployed application.

My directory structure looks like this:
/clientUtility-moving-to-pyqt5/
/clientUtility-moving-to-pyqt5/clientUtility.py
/clientUtility-moving-to-pyqt5/clientUtility_ui.py
/clientUtility-moving-to-pyqt5/job_ui.py
/clientUtility-moving-to-pyqt5/utilityMethods.py

clientUtility.py is the 'main' script.  It imports the other scripts with these unsurprising lines:
import utilityMethods
import clientUtility_ui
import job_ui

It works when started from the python interpreter but fails once pyqtdeployed.  The pyqtdeploy log shows their inclusion:
...
Freezing /Users/admin/Desktop/clientUtility-moving-to-pyqt5/clientUtility.py
Freezing /Users/admin/Desktop/clientUtility-moving-to-pyqt5/clientUtility_ui.py
Freezing /Users/admin/Desktop/clientUtility-moving-to-pyqt5/job_ui.py
Freezing /Users/admin/Desktop/clientUtility-moving-to-pyqt5/utilityMethods.py
...

But starting the pyqtdeployed app from the command line shows the problem:
"""
admins-Mac:~ admin$ /Users/admin/Desktop/clientUtility-moving-to-pyqt5/build/clientUtility.app/Contents/MacOS/clientUtility 
/Users/admin/Desktop/clientUtility-moving-to-pyqt5/build/clientUtility.app/Contents/MacOS/clientUtility: a Python exception occurred:
Traceback (most recent call last):
  File "clientUtility.py", line 14, in <module>
  File "bootstrap.py", line 2237, in _find_and_load
  File "bootstrap.py", line 2224, in _find_and_load_unlocked
ImportError: No module named 'utilityMethods'
"""

I have tried 'from . import utilityMethods' but this line fails when started from the interpreter.

Again I apologise for the 'low tech' question but any advice appreciated.

Thanks,

Dave.




--------------------------------------------
On Thu, 17/7/14, Dave Gradwell <davegradwell at yahoo.co.uk> wrote:

 Subject: Re: [PyQt] pyqtdeployed app crashes on launch
 To: pyqt at riverbankcomputing.com
 Date: Thursday, 17 July, 2014, 0:05
 
 You are right, the
 pragmatic thing to do is move to PyQt5.
 I
 will give this a shot - thanks for the advice,
 Dave.





More information about the PyQt mailing list