
Ich versuche, QGIS auf Ubuntu 18.4 zu installieren, also habe ich dieses Repo hinzugefügt:
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
Endlich habe ich meine Quellen aktualisiert und QGis installiert:
sudo apt update
sudo apt install qgis
aber beim Ausführen der Anwendung erhielt ich diese Fehler:
groot@groot-Product:~$ qgis
"<font color=\"red\">Couldn't load SIP module.<br>Python support will be disabled.</font><br><pre><br>Traceback (most recent call last):<br> File \"<string>\", line 1, in <module><br> File \"/usr/lib/python3/dist-packages/qgis/__init__.py\", line 72, in <module><br> from qgis.PyQt import QtCore<br> File \"/usr/lib/python3/dist-packages/qgis/PyQt/QtCore.py\", line 26, in <module><br> from PyQt5.QtCore import *<br>ImportError: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.12' not found (required by /home/groot/.local/lib/python3.6/site-packages/PyQt5/QtCore.so)<br><br></pre>Python version:<br>3.6.7 (default, Oct 22 2018, 11:32:17) <br>[GCC 8.2.0]<br><br>QGIS version:<br>3.4.6-Madeira 'Madeira', exported<br><br>Python path:<br>['/usr/share/qgis/python', '/home/groot/.local/share/QGIS/QGIS3/profiles/default/python', '/home/groot/.local/share/QGIS/QGIS3/profiles/default/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/home/groot/.local/lib/python3.6/site-packages', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages']"
"<font color=\"red\">An error occurred during execution of following code:<br><tt>qgis.utils.uninstallErrorHook()</tt></font><br><pre><br>Traceback (most recent call last):<br> File \"<string>\", line 1, in <module><br>NameError: name 'qgis' is not defined<br><br></pre>Python version:<br>3.6.7 (default, Oct 22 2018, 11:32:17) <br>[GCC 8.2.0]<br><br>QGIS version:<br>3.4.6-Madeira 'Madeira', exported<br><br>Python path:<br>['/usr/share/qgis/python', '/home/groot/.local/share/QGIS/QGIS3/profiles/default/python', '/home/groot/.local/share/QGIS/QGIS3/profiles/default/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/home/groot/.local/lib/python3.6/site-packages', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages']"
Und nachdem ich die Anwendung beendet habe, erhalte ich diese Fehlermeldung:
"<font color=\"red\">An error occurred during execution of following code:<br><tt>qgis.utils.uninstallErrorHook()</tt></font><br><pre><br>SystemError: PyEval_EvalCodeEx: NULL globals<br><br></pre>Python version:<br><br><br>QGIS version:<br>3.4.6-Madeira 'Madeira', exported<br><br>Python path:<br>"
groot@groot-Product:~$
Antwort1
Ich habe eine Lösung für mein Problem gefunden und meine Frage an jemanden beantwortet, der in meiner Situation feststeckt:
Nachdiese Seite auf Stack Overflow:
PyQt in PyPI ist nicht kompatibel mit dem installierten Qt
Also habe ich pyqt5 mit pip3 entfernt:
pip3 uninstall PyQt5
und PyQt5 von apt installiert:
sudo apt-get install python3-pyqt5
Jetzt scheint Qgis korrekt zu funktionieren.
Antwort2
Funktioniert bei mir auf Manjaro/ArchLinux.
Mir ist aufgefallen, dass dieser Fehler bei nicht auftritt sudo qgis
, aber das ist keine gute Lösung, da ich mein Home-Verzeichnis und nicht das von root verwenden möchte. Das deutet darauf hin, dass Berechtigungen und Pfade irgendwie falsch sind.
pip uninstall PyQt5 # defaults to pip3
sudo pacman -S python-pyqt5 python-pyqt5-sip
Jetzt startet QGIS Python erfolgreich.