[PyQt] QApplication.libraryPaths() bug?
Phil Thompson
phil at riverbankcomputing.com
Mon Feb 9 11:44:20 GMT 2015
On 09/02/2015 11:18 am, Marcus Ottosson wrote:
> I'm experiencing some odd behaviour when querying the results
> of QApplication.libraryPaths().
>
>>>> import sys
>>>> from PyQt5 import QtWidgets
>>>> app = QtWidgets.QApplication(sys.argv)
>
> This works fine.
>
>
> However, when querying libraryPaths() before instantiating
> QApplication, I
> get an error.
>
>>>> import sys
>>>> from PyQt5 import QtWidgets
>>>> QtWidgets.QApplication.libraryPaths()
> []
>>>> app = QtWidgets.QApplication(sys.argv)
> This application failed to start because it could not find or load the
> Qt
> platform plugin "windows".
>
>
> And the results of libraryPaths() differ when run afterwards.
>
>>>> import sys
>>>> from PyQt5 import QtWidgets
>>>> app = QtWidgets.QApplication(sys.argv)
>>>> QtWidgets.QApplication.libraryPaths()
> [u'C:/Python27']
>
>
> It's happening on PyQt 5.3.1 and 5.4. Is this a bug?
No. Those values are undefined until a QCoreApplication is created.
Phil
More information about the PyQt
mailing list