[GIS] QGIS 3.0 error when start in MacOS High Sierra

pythonqgis

I need help with this problem QGis 3.0 to MacOS HighSierra.
When I start QGis 3.0 its show this message.

first message…

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


    Versión de Python: 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] 
    Versión de QGIS: 3.0.0-Girona Girona, exported 
    
Ruta de Python:
* /Applications/QGIS3.app/Contents/MacOS/../Resources/python
* /Users/enver/Library/Application Support/QGIS/QGIS3/profiles/default/python
* /Users/enver/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
* /Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins
* /Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip
* /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
* /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload
* /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
* /Users/enver/Library/Application Support/QGIS/QGIS3/profiles/default/python

The second message is…

ModuleNotFoundError: No module named 'owslib' 
Traceback (most recent call last):
  File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 336, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins/MetaSearch/__init__.py", line 29, in classFactory
    from MetaSearch.plugin import MetaSearchPlugin
  File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins/MetaSearch/plugin.py", line 34, in 
    from MetaSearch.dialogs.maindialog import MetaSearchDialog
  File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins/MetaSearch/dialogs/maindialog.py", line 46, in 
    from owslib.csw import CatalogueServiceWeb # spellok
  File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'owslib'

    Versión de Python: 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] 
    Versión de QGIS: 3.0.0-Girona Girona, exported 
    
Ruta de Python:
* /Applications/QGIS3.app/Contents/MacOS/../Resources/python
* /Users/enver/Library/Application Support/QGIS/QGIS3/profiles/default/python
* /Users/enver/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
* /Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins
* /Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip
* /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
* /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload
* /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
* /Users/enver/Library/Application Support/QGIS/QGIS3/profiles/default/python

Best Answer

I assume this is the KyngChaos build, rather than one from homebrew.

The problem is that QGIS is only partially installed. GDAL and GEOS need to be installed too.

  • I suspect you installed the latest KyngChaos build, as it's showing up as /Applications/qgis3.app (no space before the 3)
  • you have the correct python installed (the official python packages from python.org, not one from brew).

Your python path should include something like this:-

/Library/Frameworks/GEOS.framework/Versions/3B/Python/3.6/site-packages
/Library/Frameworks/GDAL.framework/Versions/2.2/Python/3.6/site-packages

If you open up the .dmg package you should see a set of contents.

enter image description here

Read the readme file and make sure you install GDAL first, then QGIS (using the "1. Install GDAL complete" in the .dmg file).

I find that the KyngChaos QGIS 3.0 works happily alongside QGIS 2.18, as it keeps the files in two separate applications.

Be aware - this is an "early adopter" version, so some things may not work yet.

Related Question