Irgendwie habe ich das Gefühl, dass das meine Probleme konfigurationsbedingt sind, denn es ist sowohl Python 2.7 als auch Pathon 3.4 installiert. Beide Versionen wurden mit dnf aus Fedora Packages installiert.
Ich habe einmal versucht, folgenden Code auszuführen (mit beiden pythonversionen)
Code: Alles auswählen
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import sys
from PyQt4.QtGui import QApplication
from PyQt4.uic import loadUi
def main():
app = QApplication(sys.argv)
window = loadUi("hello.ui")
window.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
Code: Alles auswählen
[nor@localhost hello]$ python hello.py
Traceback (most recent call last):
File "hello.py", line 22, in <module>
main()
File "hello.py", line 15, in main
window = loadUi("hello.ui")
File "/usr/lib64/python2.7/site-packages/PyQt4/uic/__init__.py", line 236, in loadUi
return DynamicUILoader(package).loadUi(uifile, baseinstance, resource_suffix)
File "/usr/lib64/python2.7/site-packages/PyQt4/uic/Loader/loader.py", line 71, in loadUi
return self.parse(filename, resource_suffix, basedir)
File "/usr/lib64/python2.7/site-packages/PyQt4/uic/uiparser.py", line 974, in parse
document = parse(filename)
File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 1182, in parse
tree.parse(source, parser)
File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 647, in parse
source = open(source, "rb")
IOError: [Errno 2] Datei oder Verzeichnis nicht gefunden: 'hello.ui'
[nor@localhost hello]$ python hello.py
Traceback (most recent call last):
File "hello.py", line 22, in <module>
main()
File "hello.py", line 15, in main
window = loadUi("hello.ui")
File "/usr/lib64/python2.7/site-packages/PyQt4/uic/__init__.py", line 236, in loadUi
return DynamicUILoader(package).loadUi(uifile, baseinstance, resource_suffix)
File "/usr/lib64/python2.7/site-packages/PyQt4/uic/Loader/loader.py", line 71, in loadUi
return self.parse(filename, resource_suffix, basedir)
File "/usr/lib64/python2.7/site-packages/PyQt4/uic/uiparser.py", line 974, in parse
document = parse(filename)
File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 1182, in parse
tree.parse(source, parser)
File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 647, in parse
source = open(source, "rb")
IOError: [Errno 2] Datei oder Verzeichnis nicht gefunden: 'hello.ui'
[nor@localhost hello]$ python3 hello.py
Traceback (most recent call last):
File "hello.py", line 8, in <module>
from PyQt4.QtGui import QApplication
ImportError: No module named 'PyQt4'
[nor@localhost hello]$
[nor@localhost hello]$
[nor@localhost hello]$
[nor@localhost hello]$
[nor@localhost hello]$
[nor@localhost hello]$
[nor@localhost hello]$ python3 hello.py
Traceback (most recent call last):
File "hello.py", line 8, in <module>
from PyQt4.QtGui import QApplication
ImportError: No module named 'PyQt4'
[nor@localhost hello]$
Code: Alles auswählen
# The target Python installation.
py_platform = linux
py_inc_dir = %(sysroot)/usr/include/python%(py_major).%(py_minor)
py_pylib_dir = %(sysroot)/usr/lib/python%(py_major).%(py_minor)/config
py_pylib_lib = python%(py_major).%(py_minor)mu
# The target PyQt installation.
pyqt_module_dir = %(sysroot)/usr/lib/python%(py_major)/dist-packages
pyqt_bin_dir = %(sysroot)/usr/bin
pyqt_sip_dir = %(sysroot)/usr/share/sip/PyQt4
pyuic_interpreter = /usr/bin/python%(py_major).%(py_minor)
pyqt_disabled_features = PyQt_Desktop_OpenGL PyQt_qreal_double
# Qt configuration common to all versions.
qt_shared = True
[Qt 5.1]
pyqt_modules = QtCore QtDBus QtDesigner QtGui QtHelp QtMultimedia
QtMultimediaWidgets QtNetwork QtOpenGL QtPrintSupport QtQml QtQuick
QtSensors QtSerialPort QtSql QtSvg QtTest QtWebKit QtWebKitWidgets
QtWidgets QtXmlPatterns _QOpenGLFunctions_ES2