Re: [cx-freeze-users] "QtCore: No such file or directory" problem - resolution?
Brought to you by:
atuining
From: David C. <dav...@gm...> - 2013-11-17 20:30:19
|
OK, the following brutally stupid change fixes the problem for Qt, or at least, it allows freezing cx_Freeze/samples/PyQt4/PyQt4.app into a runnable app. I haven't tried it on my real app yet. 285a286,287 > if not os.path.isabs(dependentFile) : > dependentFile = '/Library/Frameworks/'+dependentFile This works because, when you install Qt4 using the qt-project.orginstaller, and then install the latest PyQt4 from source, the dependencies in the PyQt4 modules have the form, Qtxxxx.framework/Qtxxxx That is, they are relative paths that start with Qtxxxx.framework. I put code in _GetDependentFiles() to print out everything it found, and at least for this test case, the only relative paths were the Qt items. Everything else was an absolute path. So all I had to do was stick "/Library/Frameworks/" on the front of those, and all was well. A more general fix would be to do this only in OSX, and to test for actual existence in either of two "frameworks" places, and to leave the item alone if it is not found, something like this (untested): if dependentFile: if not os.path.isabs(dependentFile) and sys.platform == "darwin" : # check for relative paths to frameworks if os.path.isfile('/Library/Frameworks/' + dependentFile) : dependentFile = '/Library/Frameworks/' + dependentFile elif os.path.isfile('/System/Library/Frameworks/' + dependentFile) : dependentFile = '/System/Library/Frameworks/' + dependentFile dependentFiles.append(dependentFile) Thanks, Dave Cortesi On Sat, Nov 16, 2013 at 1:34 PM, Thomas Kluyver <ta...@gm...> wrote: > Hi David, > > On 15 November 2013 21:54, David Cortesi <dav...@gm...> wrote: > >> The issue status is "resolved" -- but only (if I read correctly) if I >> install Qt via Macports. I did not do this, I installed by downloading the >> latest Qt4.8.5 installer from qt-project.org, which puts everything in >> /Library/Frameworks/Qt*.framework. >> >> Is it the case that cxfreeze does not support Qt and PyQt on Mac OSX when >> Qt is installed normally? >> > > At the moment, yes, it's only been made to work with PyQt installed from > Macports, because that's what the people who wrote it and tested it were > using. If you can make it work with PyQt installed on a Mac by other means, > I imagine Anthony would be happy to merge the necessary changes. > > Best wishes, > Thomas > > > |