semiautomaticgit / SemiAutomaticClassificationPlugin

https://fromgistors.blogspot.com/p/semi-automatic-classification-plugin.html
Other
136 stars 50 forks source link

Raster stack of bands do not get created on macosx #187

Closed kaarigar closed 9 months ago

kaarigar commented 2 years ago

I am using Landsat 8 bands to create virtual raster and stacked bands. However, only the virtual raster gets created - the band stack geotiff doesn't get created. I am using QGIS Hannover LTR 3.16.11

Screen Shot 2021-10-03 at 5 31 09 PM
semiautomaticgit commented 2 years ago

Hello, I think it is an installation issue (maybe related to this https://github.com/semiautomaticgit/SemiAutomaticClassificationPlugin/issues/144).

Please copy the log file following these steps https://semiautomaticclassificationmanual.readthedocs.io/en/latest/faq.html#how-can-i-report-an-error

jsparedes commented 2 years ago

Hello @semiautomaticgit

Maybe is not related to #144

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

QGIS version | 3.16.10-Hannover -- | -- Compiled against Qt | 5.14.2 Compiled against GDAL/OGR | 3.2.1 Compiled against GEOS | 3.9.1-CAPI-1.14.2 Compiled against SQLite | 3.31.1 PostgreSQL Client Version | 12.3 QWT Version | 6.1.4 Compiled against PROJ | 6.3.2 OS Version | macOS 11.6 (BigSur)

In my case, in Settings/Debug/Test dependencies:

image

Following the snippet provided by you in [40472], these are the outputs:

import os
import sys
dPref = os.environ['PATH'].split(':')
print(dPref)
['/usr/bin', '/bin', '/usr/sbin', '/sbin']
for flPref in dPref:
    flPrefPy = os.path.join(flPref, 'python3')
    if os.path.isfile(flPrefPy):
        print(flPrefPy)
/usr/bin/python3

The log file contains:

Date    Function        Message
2021-10-07 10.49.31.502315      SemiAutomaticClassificationPlugin.semiautomaticclassificationplugin-resetSCP 1469       LOG ACTIVE SemiAutomaticClass Version 7.9.10 - Matera - QGIS v. 31610 L:en - OS Darwin - 64bit =Yes - python path =/usr/bin/python3
2021-10-07 10.49.36.848841      SemiAutomaticClassificationPlugin.semiautomaticclassificationplugin-resetSCP 1469       LOG ACTIVE SemiAutomaticClass Version 7.9.10 - Matera - QGIS v. 31610 L:en - OS Darwin - 64bit =Yes - python path =/usr/bin/python3

However, the Python error (inside Logs Messages) shows:

2021-10-07T11:15:56     WARNING    multiprocessing.pool.RemoteTraceback: 
             """
             Traceback (most recent call last):
              File "/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/GDAL-3.2.1-py3.8-macosx-10.13.0-x86_64.egg/osgeo/__init__.py", line 18, in swig_import_helper
              return importlib.import_module(mname)
              File "/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/importlib/__init__.py", line 127, in import_module
              return _bootstrap._gcd_import(name[level:], package, level)
              File "", line 1014, in _gcd_import
              File "", line 991, in _find_and_load
              File "", line 975, in _find_and_load_unlocked
              File "", line 657, in _load_unlocked
              File "", line 556, in module_from_spec
              File "", line 1101, in create_module
              File "", line 219, in _call_with_frames_removed
             ImportError: dlopen(/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/GDAL-3.2.1-py3.8-macosx-10.13.0-x86_64.egg/osgeo/_gdal.cpython-38-darwin.so, 2): Library not loaded: @rpath/libgdal.28.dylib
              Referenced from: /Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/GDAL-3.2.1-py3.8-macosx-10.13.0-x86_64.egg/osgeo/_gdal.cpython-38-darwin.so
              Reason: image not found

             During handling of the above exception, another exception occurred:

             Traceback (most recent call last):
              File "/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/multiprocessing/pool.py", line 125, in worker
              result = (True, func(*args, **kwds))
              File "/Users/jorge/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/core/utils.py", line 7614, in gdalTranslate
              from osgeo import gdal
              File "/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/GDAL-3.2.1-py3.8-macosx-10.13.0-x86_64.egg/osgeo/__init__.py", line 32, in 
              _gdal = swig_import_helper()
              File "/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/GDAL-3.2.1-py3.8-macosx-10.13.0-x86_64.egg/osgeo/__init__.py", line 31, in swig_import_helper
              return importlib.import_module('_gdal')
              File "/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/importlib/__init__.py", line 127, in import_module
              return _bootstrap._gcd_import(name[level:], package, level)
             ModuleNotFoundError: No module named '_gdal'
             """

             The above exception was the direct cause of the following exception:

             Traceback (most recent call last):
              File "/Users/jorge/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/maininterface/clipmultiplerasters.py", line 82, in clipRastersAction
              self.clipRasters()
              File "/Users/jorge/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/maininterface/clipmultiplerasters.py", line 243, in clipRasters
              cfg.utls.GDALCopyRaster(vrtCheck, f, 'GTiff', cfg.rasterCompression, 'LZW')
              File "/Users/jorge/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/core/utils.py", line 7580, in GDALCopyRaster
              res = r[0].get()
              File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/multiprocessing/pool.py", line 771, in get
              raise self._value
             ModuleNotFoundError: No module named '_gdal'
semiautomaticgit commented 2 years ago

Hello @semiautomaticgit

Maybe is not related to #144

Hello @jsparedes , it seems an installation issue. You can try to follow this guide https://semiautomaticclassificationmanual.readthedocs.io/en/latest/faq.html#i-have-installation-issues-on-mac-os-how-can-i-install-scp-on-mac-os

semiautomaticgit commented 9 months ago

I'm closing this because of the new version 8 of SCP. Please reopen it if it is still relevant in the new version. Thank you!