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

MetaSearch - ModuleNotFoundError: No module named 'owslib.ogcapi.records' #47360

Closed
2 tasks done
DelazJ opened this issue Feb 15, 2022 · 15 comments · Fixed by #47540
Closed
2 tasks done

MetaSearch - ModuleNotFoundError: No module named 'owslib.ogcapi.records' #47360

DelazJ opened this issue Feb 15, 2022 · 15 comments · Fixed by #47540
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers MetaSearch

Comments

@DelazJ
Copy link
Contributor

DelazJ commented Feb 15, 2022

What is the bug or the crash?

On a self-compiled QGIS, new user profile

Impossible de charger l'extension 'MetaSearch' provoque une erreur lors de l'appel à sa méthode classFactory() 

ModuleNotFoundError: No module named 'owslib.ogcapi.records' 
Traceback (most recent call last):
  File "/media/delazj/TRAVAIL/dev/github/QGIS/build-ninja/output/python/qgis/utils.py", line 423, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/media/delazj/TRAVAIL/dev/github/QGIS/build-ninja/output/python/plugins/MetaSearch/__init__.py", line 29, in classFactory
    from MetaSearch.plugin import MetaSearchPlugin
  File "/media/delazj/TRAVAIL/dev/github/QGIS/build-ninja/output/python/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/media/delazj/TRAVAIL/dev/github/QGIS/build-ninja/output/python/plugins/MetaSearch/plugin.py", line 34, in 
    from MetaSearch.dialogs.maindialog import MetaSearchDialog
  File "/media/delazj/TRAVAIL/dev/github/QGIS/build-ninja/output/python/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/media/delazj/TRAVAIL/dev/github/QGIS/build-ninja/output/python/plugins/MetaSearch/dialogs/maindialog.py", line 49, in 
    from MetaSearch.dialogs.newconnectiondialog import NewConnectionDialog
  File "/media/delazj/TRAVAIL/dev/github/QGIS/build-ninja/output/python/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/media/delazj/TRAVAIL/dev/github/QGIS/build-ninja/output/python/plugins/MetaSearch/dialogs/newconnectiondialog.py", line 34, in 
    from MetaSearch.search_backend import CATALOG_TYPES
  File "/media/delazj/TRAVAIL/dev/github/QGIS/build-ninja/output/python/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/media/delazj/TRAVAIL/dev/github/QGIS/build-ninja/output/python/plugins/MetaSearch/search_backend.py", line 29, in 
    from owslib.ogcapi.records import Records
  File "/media/delazj/TRAVAIL/dev/github/QGIS/build-ninja/output/python/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'owslib.ogcapi.records'


Version de Python : 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0] 
Version de QGIS : 3.23.0-Master Master, 180a0d3208 

Steps to reproduce the issue

Happens when I launch QGIS
I used to have weeks ago, and didn't notice it in recent days. but opening QGIS from a new profile resurrects it.

Versions

<style type="text/css"> p, li { white-space: pre-wrap; } </style>
Version de QGIS 3.23.0-Master Révision du code 180a0d3
Version de Qt 5.12.8
Version de Python 3.8.10
Version de GDAL/OGR 3.0.4
Version de Proj 6.3.1
Version de la base de données du registre EPSG v9.8.6 (2020-01-22)
Compilé avec GEOS 3.8.0-CAPI-1.13.1 Utilisé avec GEOS 3.8.0-CAPI-1.13.1
Version de SQLite 3.31.1
Version du client PostgreSQL 12.9 (Ubuntu 12.9-0ubuntu0.20.04.1)
Version de SpatiaLite 4.3.0a
Version de QWT 6.1.4
Version de QScintilla2 2.11.2
Version de l'OS Ubuntu 20.04.3 LTS
       
Cette copie de QGIS dispose d'une sortie de débogage.
       
Extensions Python actives
db_manager 0.1.20
grassprovider 2.12.99
processing 2.12.99
sagaprovider 2.12.99

Cette copie de QGIS dispose d'une sortie de débogage.

Extensions Python actives
db_manager
0.1.20
grassprovider
2.12.99
processing
2.12.99
sagaprovider
2.12.99

Supported QGIS version

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

New profile

  • I tried with a new QGIS profile

Additional context

No response

@DelazJ DelazJ added Bug Either a bug report, or a bug fix. Let's hope for the latter! MetaSearch labels Feb 15, 2022
@alexbruy
Copy link
Contributor

Seems you distro has quite old OWS lib.

@alexbruy
Copy link
Contributor

@tomkralidis may I ask you to look at this? It would be nice to get it addressed before 3.24.

@tomkralidis
Copy link
Contributor

What version of owslib is on your install? Can you test from the QGIS Python console with:

>>> import owslib
>>> owslib.__version__

@gioman gioman added the Feedback Waiting on the submitter for answers label Feb 15, 2022
@DelazJ
Copy link
Contributor Author

DelazJ commented Feb 15, 2022

0.19.1

@tomkralidis
Copy link
Contributor

OWSLib 0.25 or higher is required for the new OGC API - Records functionality. Should I put a try/except test on the OWSLib version?

@DelazJ
Copy link
Contributor Author

DelazJ commented Feb 15, 2022

I think it was the idea, reading #44812 (comment)

@alexbruy
Copy link
Contributor

I'd say better to include a fallback code path to avoid errors like this one on platforms where older OWSLib installed.

@gioman
Copy link
Contributor

gioman commented Feb 19, 2022

This is now in 3.24.0

#47444

@UtaVile
Copy link

UtaVile commented Feb 25, 2022

Still getting this error after a fresh install and each time the software opens.
I'm using QGIS 3.24.0 and Ubuntu 20.04.4 lts

Everything is working so far tho and I'm not sure I would even use the OGC records API features.

Thanks for continually and consistently producing some of the best GIS software out there!

@huard
Copy link

huard commented Feb 25, 2022

Same here, had to sudo pip install --upgrade owslib to get rid of the error, which hopefully won't break anything elsewhere.

@tomkralidis
Copy link
Contributor

PR in #47540

tomkralidis added a commit to tomkralidis/QGIS that referenced this issue Feb 25, 2022
@jkariscodes
Copy link

Same here, had to sudo pip install --upgrade owslib to get rid of the error, which hopefully won't break anything elsewhere.

This worked out for me. I however did not use sudo.

@martinvanbuuren
Copy link

Quickfix for homebrew users on MacOS

A quickfix for people who installed qgis using homebrew. From the terminal, type
/Applications/QGIS.app/Contents/MacOS/bin/python3.9 -m pip install --upgrade owslib

For me it took a while before I found the python 3.9.5 executable location... hope it helps.

@andrew-c-duncan
Copy link

Quickfix for homebrew users on MacOS

A quickfix for people who installed qgis using homebrew. From the terminal, type /Applications/QGIS.app/Contents/MacOS/bin/python3.9 -m pip install --upgrade owslib

For me it took a while before I found the python 3.9.5 executable location... hope it helps.

This also works for the standard MacOS install of QGIS

@manuelmx
Copy link

manuelmx commented Mar 9, 2022

Quickfix for homebrew users on MacOS
A quickfix for people who installed qgis using homebrew. From the terminal, type /Applications/QGIS.app/Contents/MacOS/bin/python3.9 -m pip install --upgrade owslib
For me it took a while before I found the python 3.9.5 executable location... hope it helps.

This also works for the standard MacOS install of QGIS

Thanks for the help, problem is fixed.

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! Feedback Waiting on the submitter for answers MetaSearch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants