Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named '_gdal' #55519

Closed
2 tasks done
ACalleros opened this issue Dec 5, 2023 · 10 comments
Closed
2 tasks done

No module named '_gdal' #55519

ACalleros opened this issue Dec 5, 2023 · 10 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Build/Install Related to compiling or installing QGIS Downstream Downstream packaging issues etc. Feedback Waiting on the submitter for answers Linux Packaging

Comments

@ACalleros
Copy link

ACalleros commented Dec 5, 2023

What is the bug or the crash?

I am running Arch linux and updated qgis to the latest release. Since, it hasn't been able to locate gdal. It's the first time I have this kind of problem, what can I do?

`Couldn't load plugin 'processing'

ModuleNotFoundError: No module named '_gdal'
Traceback (most recent call last):
File "/home/adrian/.local/lib/python3.11/site-packages/osgeo/init.py", line 30, in swig_import_helper
return importlib.import_module(mname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 676, in _load_unlocked
File "", line 573, in module_from_spec
File "", line 1233, in create_module
File "", line 241, in _call_with_frames_removed
ImportError: libgdal.so.33: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/qgis/utils.py", line 401, in loadPlugin
import(packageName)
File "/usr/lib/python3.11/site-packages/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/qgis/python/plugins/processing/init.py", line 24, in
from processing.tools.general import * # NOQA
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/qgis/python/plugins/processing/tools/general.py", line 30, in
from processing.core.Processing import Processing
File "/usr/lib/python3.11/site-packages/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/qgis/python/plugins/processing/core/Processing.py", line 55, in
from processing.algs.qgis.QgisAlgorithmProvider import QgisAlgorithmProvider # NOQA
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/qgis/python/plugins/processing/algs/qgis/QgisAlgorithmProvider.py", line 45, in
from .HypsometricCurves import HypsometricCurves
File "/usr/lib/python3.11/site-packages/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/qgis/python/plugins/processing/algs/qgis/HypsometricCurves.py", line 25, in
from osgeo import gdal, ogr, osr
File "/usr/lib/python3.11/site-packages/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/adrian/.local/lib/python3.11/site-packages/osgeo/init.py", line 35, in
_gdal = swig_import_helper()
^^^^^^^^^^^^^^^^^^^^
File "/home/adrian/.local/lib/python3.11/site-packages/osgeo/init.py", line 32, in swig_import_helper
return importlib.import_module('_gdal')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named '_gdal'

Python version: 3.11.6 (main, Nov 14 2023, 09:36:21) [GCC 13.2.1 20230801]
QGIS version: 3.34.1-Prizren Prizren, exported

Python Path:
/usr/share/qgis/python
/home/adrian/.local/share/QGIS/QGIS3/profiles/default/python
/home/adrian/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib/python311.zip
/usr/lib/python3.11
/usr/lib/python3.11/lib-dynload
/home/adrian/.local/lib/python3.11/site-packages
/usr/lib/python3.11/site-packages
/home/adrian/.local/share/QGIS/QGIS3/profiles/default/python`

Steps to reproduce the issue

  1. Open QGIS
  2. Open log messages
  3. Click on python errors

Versions

<style type="text/css"> p, li { white-space: pre-wrap; } </style>
QGIS version 3.34.1-Prizren QGIS code branch Release 3.34
Qt version 5.15.11
Python version 3.11.6
Compiled against GDAL/OGR 3.8.0 Running against GDAL/OGR 3.8.1
Compiled against PROJ 9.3.0 Running against PROJ 9.3.1
EPSG Registry database version v10.098 (2023-11-24)
GEOS version 3.12.0-CAPI-1.18.0
SQLite version 3.44.2
PDAL version 2.6.1
PostgreSQL client version 16.1
SpatiaLite version 5.1.0
QWT version 6.2.0
QScintilla2 version 2.14.1
OS version EndeavourOS
       
Active Python plugins
db_manager 0.1.20
QGIS version 3.34.1-Prizren QGIS code branch [Release 3.34](https://github.com/qgis/QGIS/tree/release-3_34) Qt version 5.15.11 Python version 3.11.6 Compiled against GDAL/OGR 3.8.0 Running against GDAL/OGR 3.8.1 Compiled against PROJ 9.3.0 Running against PROJ 9.3.1 EPSG Registry database version v10.098 (2023-11-24) GEOS version 3.12.0-CAPI-1.18.0 SQLite version 3.44.2 PDAL version 2.6.1 PostgreSQL client version 16.1 SpatiaLite version 5.1.0 QWT version 6.2.0 QScintilla2 version 2.14.1 OS version EndeavourOS

Active Python plugins
db_manager
0.1.20

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

@ACalleros ACalleros added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Dec 5, 2023
@ACalleros
Copy link
Author

Also tried using a flatpak with the same error

@DelazJ
Copy link
Contributor

DelazJ commented Dec 7, 2023

`Couldn't load plugin 'processing'

Out of curiosity, have you enabled the Processing plugin (in Plugins Manager)?

@ACalleros
Copy link
Author

`Couldn't load plugin 'processing'

Out of curiosity, have you enabled the Processing plugin (in Plugins Manager)?

Yup, gives me the same error

@agiudiceandrea agiudiceandrea added Build/Install Related to compiling or installing QGIS Linux labels Dec 12, 2023
@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Dec 12, 2023

It looks like a packaging issue for Arch Linux / EndevourOS: please see https://gitlab.archlinux.org/archlinux/packaging/packages/qgis/-/issues/1

@agiudiceandrea agiudiceandrea added Packaging Downstream Downstream packaging issues etc. Feedback Waiting on the submitter for answers labels Dec 12, 2023
Copy link

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale".
If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.

@github-actions github-actions bot added stale Uh oh! Seems this work is abandoned, and the PR is about to close. and removed stale Uh oh! Seems this work is abandoned, and the PR is about to close. labels Dec 27, 2023
Copy link

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale".
If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jan 11, 2024
Copy link

github-actions bot commented Feb 9, 2024

While we hate to see this happen, this issue has been automatically closed because it has not had any activity in the last 42 days despite being marked as feedback. If this issue should be reconsidered, please follow the guidelines in the previous comment and reopen this issue.
Or, if you have any further questions, there are also further support channels that can help you.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 9, 2024
@dangarciahe
Copy link

dangarciahe commented Mar 25, 2024

I had this issue in my Manjaro install. The steps to fix it in my case was installing the arrow package and its dependencies. See OSGeo/gdal#6281.

To verify it is fixed, try running gdalinfo --version on console:

$ gdalinfo --version
GDAL 3.8.4, released 2024/02/08

If you still see errors on the form ERROR 1: libarrow.so.1500: cannot open shared object file: No such file or directory then I can't help further, but that's your path to fixing the error and finding extra info on the internet (or at least it greatly helped me).

A final note is that QGIS opens fine even if the output from $ gdalinfo --version is ERROR 1: libpodofo.so.2: cannot open shared object file: No such file or directory, but you'll see some features not working. To fix that error, I installed podofo.

@github-actions github-actions bot removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Mar 25, 2024
@ACalleros
Copy link
Author

I had this issue in my Manjaro install. The steps to fix it in my case was installing the arrow package and its dependencies. See OSGeo/gdal#6281.

To verify it is fixed, try running gdalinfo --version on console:

$ gdalinfo --version GDAL 3.8.4, released 2024/02/08

If you still see errors on the form ERROR 1: libarrow.so.1500: cannot open shared object file: No such file or directory then I can't help further, but that's your path to fixing the error and finding extra info on the internet (or at least it greatly helped me).

A final note is that QGIS opens fine even if the output from $ gdalinfo --version is ERROR 1: libpodofo.so.2: cannot open shared object file: No such file or directory, but you'll see some features not working. To fix that error, I installed podofo.

I tried installing the missing files, in my case mariadb and libheif, but I am still getting No module named gdal

@dangarciahe
Copy link

Sorry, I don't remember having that issue. Try checking gdal in your repos.

As a last resort work-around, you can try installing QGIS using Conda. The dependencies are handled in a different way in Conda, which solved some of the issues I had.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Build/Install Related to compiling or installing QGIS Downstream Downstream packaging issues etc. Feedback Waiting on the submitter for answers Linux Packaging
Projects
None yet
Development

No branches or pull requests

4 participants