在Manjaro Linux上,QGIS 3.0无法加载插件处理,没有名为“ osgeo”的模块


14

我已经从AUR软件包以及所有可选的依赖项中安装了QGIS3:https ://aur.archlinux.org/packages/qgis/

但是,启动时,出现以下错误:

Couldn't load plugin 'processing' 

ModuleNotFoundError: No module named 'osgeo' 
Traceback (most recent call last):
  File "/usr/share/qgis/python/qgis/utils.py", line 311, in loadPlugin
    __import__(packageName)
  File "/usr/share/qgis/python/qgis/utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/share/qgis/python/plugins/processing/__init__.py", line 28, in 
    from processing.tools.dataobjects import *          # NOQA
  File "/usr/share/qgis/python/qgis/utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/share/qgis/python/plugins/processing/tools/dataobjects.py", line 51, in 
    from processing.algs.gdal.GdalUtils import GdalUtils
  File "/usr/share/qgis/python/qgis/utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/share/qgis/python/plugins/processing/algs/gdal/GdalUtils.py", line 35, in 
    from osgeo import gdal
  File "/usr/share/qgis/python/qgis/utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'osgeo'


Python version: 3.6.4 (default, Jan  5 2018, 02:35:40) [GCC 7.2.1 20171224] 
QGIS version: 3.0.0-Girona Girona, exported 

Python Path:
/usr/share/qgis/python
/home/thiago/.local/share/QGIS/QGIS3/profiles/default/python
/home/thiago/.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
/usr/lib/python3.6/site-packages
/home/thiago/.local/share/QGIS/QGIS3/profiles/default/python

这似乎是一个路径问题,但我不确定如何解决。Pacman显示gdal和python-gdal都已安装。

Answers:


4

安装python缺少的模块:

yaourt -S python-gdal

然后安装pip包:

pacman -S python-pip

并使用以下方法安装缺少的模块:

pip install MissingModuleName

1
安装python-gdal为我解决了这个问题。似乎他们忘记了依赖性。
Golar Ramblar

此外,python-gdal我还必须手动安装python-psycopg2 python-owslib
elig

3

尝试重新编译您的gdalpython-gdal。但是,这可能会影响任何取决于它们的东西。您可能还需要重新编译它们。通常是:

  • qgis
  • 英雄传奇
  • 诽谤

2

原来的问题是我在路径上安装了Anaconda Python,因此将python-gdal编译为Anaconda路径,而不是常规系统路径。我从路径中删除了Anaconda(编辑.bashrc文件),然后删除并重新编译了python-gdal。谢谢你们。


2
嗨,你怎么做到的?

2

Marcelo Villa 3月27日

这对我有用。安装的“ pip”是一个较旧的版本,提示我进行升级,但是新版本显然存在问题。

由于我是Manjaro和所有Arch的新手,因此学习语法很重要。我对Ubuntu世界非常熟悉,但这对我来说似乎是新的。谢谢马塞洛!


而不是发布包含代码的图片,您应该粘贴代码本身并使用{}按钮对其进行格式设置
Marcelo Villa

1

我已经通过简单地按照QGIS 3.2文件夹中提供的说明解决了这一问题。看来安装顺序确实很重要,可以正确解决问题。就我而言,我在QGIS安装之后运行了Python安装。

  1. 安装Python。它应该是3.6版本,当前的3.7更新并没有使它更容易。随附链接:https//www.python.org/downloads/release/python-366/

  2. 使用“ 2 Install GDAL Complete Complete.pkg”安装GDAL

  3. 安装“ 3安装QGIS 3.pkg”


0

我只需要使用他们的安装程序重新安装gdal和QGIS3,问题就消失了。我什至没有先删除现有版本。速度很快,因此希望对您也有用!

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.