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

ImportError: cannot import name 'DMD_CREATIONFIELDDATASUBTYPES' from 'osgeo.gdalconst' #986

Open
adammwilson opened this issue Sep 25, 2024 · 3 comments
Assignees
Labels
bug Something isn't working feedback Waiting on the submitter for answer workaround Known issue, but a workaround exists

Comments

@adammwilson
Copy link

I just upgraded to the new QGIS-LTR (v3.34) and used the plugin manager to install enmap-box (3.14.3) on macOS 15.0 (Sequoia).

I get the following error when installing (or loading) the plugin. This has also been reported on stack exchange with no posted solutions.

Any ideas?

Couldn't load plugin 'enmapboxplugin' due to an error when calling its classFactory() method 

ImportError: cannot import name 'DMD_CREATIONFIELDDATASUBTYPES' from 'osgeo.gdalconst' (/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/GDAL-3.3.2-py3.9-macosx-10.13.0-x86_64.egg/osgeo/gdalconst.py) 
Traceback (most recent call last):
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 423, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/__init__.py", line 51, in classFactory
    plugin = EnMAPBoxPlugin(iface)
  File "/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/enmapboxplugin.py", line 54, in __init__
    enmapbox.initAll()
  File "/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/__init__.py", line 358, in initAll
    registerSpectralLibraryIOs()
  File "/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/qgispluginsupport/qps/__init__.py", line 176, in registerSpectralLibraryIOs
    initSpectralLibraryIOs()
  File "/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/qgispluginsupport/qps/speclib/core/spectrallibraryio.py", line 1066, in initSpectralLibraryIOs
    from ..io.geopackage import GeoPackageSpectralLibraryIO
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/qgispluginsupport/qps/speclib/io/geopackage.py", line 6, in 
    from osgeo.gdalconst import DMD_CREATIONFIELDDATASUBTYPES
ImportError: cannot import name 'DMD_CREATIONFIELDDATASUBTYPES' from 'osgeo.gdalconst' (/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/GDAL-3.3.2-py3.9-macosx-10.13.0-x86_64.egg/osgeo/gdalconst.py)


Python version: 3.9.5 (default, Sep 10 2021, 16:18:19) [Clang 12.0.5 (clang-1205.0.22.11)] 
QGIS version: 3.34.11-Prizren Prizren, 2904bcec7c9 

Python Path:
/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/plugins
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/rasterio-1.1.5-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/netCDF4-1.5.4-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/cftime-1.2.1-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/pyproj-3.2.0-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/lib-dynload
/Users/user/.local/lib/python3.9/site-packages
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/pandas-1.3.3-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/matplotlib-3.3.0-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/patsy-0.5.1-py3.9.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/statsmodels-0.11.1-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/numba-0.50.1-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/opencv_contrib_python-4.3.0.36-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/Fiona-1.8.13.post1-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/Pillow-7.2.0-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python39.zip
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/geopandas-0.8.1-py3.9.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/Rtree-0.9.7-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9/site-packages/GDAL-3.3.2-py3.9-macosx-10.13.0-x86_64.egg
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/qfieldsync/libqfieldsync.whl
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/site-packages
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/qgispluginsupport/qps/pyqtgraph
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/site-packages
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/apps
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/coreapps
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/eo4qapps
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/site-packages
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/site-packages
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/site-packages
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/site-packages
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/site-packages
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/site-packages
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/site-packages
/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/site-packages
Library Version
QGIS version 3.34.11-Prizren
Qt version 5.15.2
Python version 3.9.5
GDAL/OGR version 3.3.2
PROJ version 8.1.1
EPSG Registry database version v10.028 (2021-07-07)
GEOS version 3.9.1-CAPI-1.14.2
SQLite version 3.35.2
PDAL version 2.3.0
PostgreSQL client version unknown
SpatiaLite version 5.0.1
QWT version 6.1.6
QScintilla2 version 2.11.5
OS version macOS 15.0
@janzandr
Copy link
Contributor

@jakimowb can you help?

@janzandr janzandr added the bug Something isn't working label Sep 25, 2024
@jakimowb
Copy link
Contributor

Dear @adammwilson , this is a known problem. The standard QGIS for macOS comes with an heavily outdated GDAL version (see #843)
Either install the QGIS.app provided by OpenGIS.ch, or use the conda installer. See https://enmap-box.readthedocs.io/en/latest/usr_section/usr_installation.html#qgis-installation-on-macos for details.

@jakimowb
Copy link
Contributor

@adammwilson please let me know if my previous comment solve the problem, so that I can close this issue.

@jakimowb jakimowb added feedback Waiting on the submitter for answer workaround Known issue, but a workaround exists labels Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feedback Waiting on the submitter for answer workaround Known issue, but a workaround exists
Projects
None yet
Development

No branches or pull requests

3 participants