我试图在Ubuntu18.4上安装QGIS,因此我添加了这个回购程序:
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update最后更新了我的源代码,并安装了QGis:
sudo apt update
sudo apt install qgis但是,在运行应用程序时,我得到了以下错误:
groot@groot-Product:~$ qgis
"Couldn't load SIP module.
Python support will be disabled.
Traceback (most recent call last):
File \"\", line 1, in
File \"/usr/lib/python3/dist-packages/qgis/__init__.py\", line 72, in
from qgis.PyQt import QtCore
File \"/usr/lib/python3/dist-packages/qgis/PyQt/QtCore.py\", line 26, in
from PyQt5.QtCore import *
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)
Python version:
3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0]
QGIS version:
3.4.6-Madeira 'Madeira', exported
Python path:
['/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']"
"An error occurred during execution of following code:
qgis.utils.uninstallErrorHook()
Traceback (most recent call last):
File \"\", line 1, in
NameError: name 'qgis' is not defined
Python version:
3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0]
QGIS version:
3.4.6-Madeira 'Madeira', exported
Python path:
['/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']"退出应用程序后,我得到以下错误:
"An error occurred during execution of following code:
qgis.utils.uninstallErrorHook()
SystemError: PyEval_EvalCodeEx: NULL globals
Python version:
QGIS version:
3.4.6-Madeira 'Madeira', exported
Python path:
"
groot@groot-Product:~$ 发布于 2019-05-17 12:40:57
我找到了解决我的问题的办法,所以我对陷入困境的人回答了我的问题:
根据堆栈溢出上的此页:
PyQt中的PyPI与已安装的Qt不兼容。
因此,我使用pyqt5删除了pip3:
pip3 uninstall PyQt5并从apt安装了PyQt5:
sudo apt-get install python3-pyqt5现在,Qgis似乎工作正常。
发布于 2020-11-28 17:13:56
在Manjaro / ArchLinux为我工作。
我注意到在sudo qgis中没有这个错误,但是这不是一个好的解决方案,因为我想使用我的主目录,而不是根目录。提示权限和路径被关闭了。
pip uninstall PyQt5 # defaults to pip3
sudo pacman -S python-pyqt5 python-pyqt5-sip现在,QGIS成功地发布了python。
https://askubuntu.com/questions/1144003
复制相似问题