21

I have installed QGIS3 from the AUR package, as well as all optional dependencies: https://aur.archlinux.org/packages/qgis/

However, when launching, I receive the following error:

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

It seems to be a path issue, but I am not sure how to solve it. Pacman shows gdal and python-gdal both as installed.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
thi_sanna
  • 429
  • 1
  • 3
  • 8
  • 3
    This is required for latest QGis on latest Manjaro: sudo pacman -S python-gdal python-psycopg2 python-owslib python-pygments – zenw0lf Apr 19 '20 at 20:25

7 Answers7

9

Install the python missing module:

yaourt -S python-gdal

Then install the pip package:

pacman -S python-pip

and install the missing modules using:

pip install MissingModuleName
Marcelo Villa
  • 5,928
  • 2
  • 19
  • 38
3

Try to recompile your gdal and python-gdal. However, it may affect anything depending on them. You may need to recompile them as well. They are usually:

  • qgis
  • grass
  • saga-gis-ltr
  • liblas
Yu-Hsuan
  • 71
  • 3
2

Turns out the problem is that I had Anaconda Python installed and on the path, so python-gdal was compiled to the Anaconda path, instead of the regular system path. I removed Anaconda from path (editing the .bashrc file), then removed and recompiled python-gdal. Thank you all.

thi_sanna
  • 429
  • 1
  • 3
  • 8
2

Marcelo Villa Mar 27

This worked for me. "pip" that installed was an older version, prompting me to upgrade, but there are issues with the new version, apparently.

Since I am a newbie to Manjaro and all things Arch, learning the syntax is important. I am very familiar with the Ubuntu world, but this all seems new to me. Thanks Marcelo!

1

I've solved this by simply following the provided instructions in the QGIS 3.2 folder. It seems that the order of installation really does matter to get things right. In my case I was running the Python installation after the QGIS installation.

  1. Install Python. It should be a 3.6 version, the current 3.7 update doesn't make it easier. Herewith the link: https://www.python.org/downloads/release/python-366/

  2. Install GDAL with "2 Install GDAL Complete Complete.pkg"

  3. Install "3 Install QGIS 3.pkg"

Eric
  • 11
  • 1
1

This is likely OS-specific but in Manjaro I have to install few extra packages to get QGIS starting without errors about missing modules.

These are the packages listed in zenw0lf comment in the OP, and the last one needed for jinja2 module

sudo pacman -S python-gdal python-psycopg2 python-owslib python-pygments python-jinja
Dr J
  • 11
  • 1
0

I just had to reinstall gdal and QGIS3 using their installers and the problem went away. I didn't even remove my existing versions first. It was fast, so hope that works for you too!

lucas
  • 223
  • 1
  • 9