[PyQt] possible issue with PyQt5/QtMultimedia?

Phil Thompson phil at riverbankcomputing.com
Thu Nov 12 08:17:36 GMT 2015


On 11 Nov 2015, at 9:50 p.m., David Beck <dbeck at ualberta.ca> wrote:
> 
> I’m bulding an application using Qt5.5.1/PyQt5.5 on a Mac running OS 10.11 and bundling it as a standalone using py2app. As part of updating for Qt5, I needed to change references to QtGui.QSound from Qt4 to QtMultimedia.QSound. However, once I imported QtMultimedia, my bundled app began crashing on start up. I got the following in the Console:
> 
> 11/11/2015 2:32:44.887 PM eFieldbook[3648]: 2015-11-11 14:32:44.887 eFieldbook[3648:1104572] eFieldbook Error
> 11/11/2015 2:32:47.366 PM sharedfilelistd[301]: SecTaskLoadEntitlements failed error=22
> 11/11/2015 2:32:47.368 PM eFieldbook[3648]: Traceback (most recent call last):
> 11/11/2015 2:32:47.368 PM eFieldbook[3648]:   File "/Users/David/Library/Mobile Documents/com~apple~CloudDocs/Current/ELFB/eFieldBook_Qt5/dist/eFieldbook.app/Contents/Resources/__boot__.py", line 351, in <module>
> 11/11/2015 2:32:47.368 PM eFieldbook[3648]:     _run()
> 11/11/2015 2:32:47.368 PM eFieldbook[3648]:   File "/Users/David/Library/Mobile Documents/com~apple~CloudDocs/Current/ELFB/eFieldBook_Qt5/dist/eFieldbook.app/Contents/Resources/__boot__.py", line 336, in _run
> 11/11/2015 2:32:47.368 PM eFieldbook[3648]:     exec(compile(source, path, 'exec'), globals(), globals())
> 11/11/2015 2:32:47.368 PM eFieldbook[3648]:   File "/Users/David/Library/Mobile Documents/com~apple~CloudDocs/Current/ELFB/eFieldBook_Qt5/dist/eFieldbook.app/Contents/Resources/eFieldbook.py", line 2, in <module>
> 11/11/2015 2:32:47.368 PM eFieldbook[3648]:     from ui.fieldbook import MainWindow
> 11/11/2015 2:32:47.368 PM eFieldbook[3648]:   File "ui/fieldbook.pyc", line 13, in <module>
> 11/11/2015 2:32:47.368 PM eFieldbook[3648]:   File "cardLoader.pyc", line 4, in <module>
> 11/11/2015 2:32:47.368 PM eFieldbook[3648]:   File "contextMenus.pyc", line 2, in <module>
> 11/11/2015 2:32:47.368 PM eFieldbook[3648]:   File "linksMenu.pyc", line 2, in <module>
> 11/11/2015 2:32:47.369 PM eFieldbook[3648]:   File "soundBtns.pyc", line 1, in <module>
> 11/11/2015 2:32:47.369 PM eFieldbook[3648]:   File "PyQt5/QtMultimedia.pyc", line 14, in <module>
> 11/11/2015 2:32:47.369 PM eFieldbook[3648]:   File "PyQt5/QtMultimedia.pyc", line 10, in __load
> 11/11/2015 2:32:47.369 PM eFieldbook[3648]:   File "imp.pyc", line 342, in load_dynamic
> 11/11/2015 2:32:47.369 PM eFieldbook[3648]: ImportError: No module named 'PyQt5.QtNetwork'
> 
> The same code works fine if I run it in IDLE or Eric 6. If I import QtNetwork into my project, I can bundle the app and run it without any problems. However, I don’t use the QtNetwork module (and I get a warning about importing an unused module from Eric). This might mean something is up with QtMultimedia or PyQt5?

QtMultimedia has an internal dependency on QtNetwork. Presumably py2app doesn't know about this.

Phil


More information about the PyQt mailing list