semiautomaticgit / SemiAutomaticClassificationPlugin

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

Issues with Python 3.9 on new OSGeo4W installer #168

Closed PedroVenancio closed 3 years ago

PedroVenancio commented 3 years ago

Dear Luca,

I'm unable to use SCP with the newer OSGeo4W installer (testing), that uses only Python 3.9. https://qgis.org/en/site/forusers/download.html

This same workflow works as expected with QGIS using the standard OSGeo4W installer, that uses Python 3.7, but fails with Python 3.9.

I'm attaching the entire log, but the interesting part is

2021-04-01 16.35.36.183792  SemiAutomaticClassificationPlugin.core.utils-getProxyHandler 317    
2021-04-01 16.35.50.416621  SemiAutomaticClassificationPlugin.core.utils-selectLayerbyName 6702 layer selected: L1C_T29TNF_A029921_20210315T112446_p.jp2
2021-04-01 16.35.50.429628  SemiAutomaticClassificationPlugin.core.utils-selectLayerbyName 6702 layer selected: L2A_T29TNF_A020941_20210310T112113_p.jp2
2021-04-01 16.35.50.439560  SemiAutomaticClassificationPlugin.core.utils-selectLayerbyName 6702 layer selected: L1C_T29TNF_A020941_20210310T112113_p.jp2
2021-04-01 16.35.50.449533  SemiAutomaticClassificationPlugin.core.utils-selectLayerbyName 6702 layer selected: L2A_T29TNF_A029778_20210305T112449_p.jp2
2021-04-01 16.35.50.460503  SemiAutomaticClassificationPlugin.core.utils-selectLayerbyName 6702 layer selected: L1C_T29TNF_A029778_20210305T112449_p.jp2
2021-04-01 16.35.50.474466  SemiAutomaticClassificationPlugin.core.utils-selectLayerbyName 6702 layer selected: L2A_T29TNF_A020798_20210228T112803_p.jp2
2021-04-01 16.35.50.490423  SemiAutomaticClassificationPlugin.core.utils-selectLayerbyName 6702 layer selected: L1C_T29TNF_A020798_20210228T112803_p.jp2
2021-04-01 16.35.50.506381  SemiAutomaticClassificationPlugin.core.utils-selectLayerbyName 6702 layer selected: L2A_T29TNF_A029635_20210223T112449_p.jp2
2021-04-01 16.35.50.521406  SemiAutomaticClassificationPlugin.core.utils-selectLayerbyName 6702 layer selected: L1C_T29TNF_A029635_20210223T112449_p.jp2
2021-04-01 16.35.50.534306  SemiAutomaticClassificationPlugin.core.utils-selectLayerbyName 6702 layer selected: L2A_T29TNF_A020655_20210218T112238_p.jp2
2021-04-01 16.35.50.544279  SemiAutomaticClassificationPlugin.core.utils-selectLayerbyName 6702 layer selected: L1C_T29TNF_A020655_20210218T112238_p.jp2
2021-04-01 16.35.50.556248  SemiAutomaticClassificationPlugin.core.utils-selectLayerbyName 6702 layer selected: L2A_T29TNF_A029492_20210213T112445_p.jp2
2021-04-01 16.35.50.570212  SemiAutomaticClassificationPlugin.core.utils-selectLayerbyName 6702 layer selected: L1C_T29TNF_A029492_20210213T112445_p.jp2
2021-04-01 16.35.50.584172  SemiAutomaticClassificationPlugin.core.utils-selectLayerbyName 6702 layer selected: L2A_T29TNF_A020512_20210208T112318_p.jp2
2021-04-01 16.35.50.598135  SemiAutomaticClassificationPlugin.core.utils-selectLayerbyName 6702 layer selected: L1C_T29TNF_A020512_20210208T112318_p.jp2
2021-04-01 16.35.50.621113  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-populateTable 111   ERROR exception: list index out of range
2021-04-01 16.35.50.740766  SemiAutomaticClassificationPlugin.core.utils-createVirtualRaster 2614   virtual raster: D:/Temp/semiautomaticclassification/20210401_155448117873/20210401_163550644012315vrt_temp_.vrt
2021-04-01 16.36.25.547240  SemiAutomaticClassificationPlugin.core.utils-createRasterFromReference 3098 raster ['D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_1635507547176110_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_1635507547176111_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_1635507547176112_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_1635507547176113_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_1635507547176114_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_1635507547176115_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_1635507547176116_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_1635507547176117_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_1635507547176118_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_1635507547176119_temp.tif']
2021-04-01 16.36.30.275150  SemiAutomaticClassificationPlugin.core.utils-multiProcessRaster 4788    start processRaster
2021-04-01 16.36.32.126394  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinelReflectance 337     ERROR exception: Traceback (most recent call last):
  File "C:\OSGeo4W\apps\Python39\lib\site-packages\osgeo\__init__.py", line 18, in swig_import_helper
    return importlib.import_module(mname)
  File "C:\OSGeo4W\apps\Python39\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 565, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1108, in create_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
ImportError: DLL load failed while importing _gdal: Impossível localizar o módulo especificado.

On Windows, with Python >= 3.8, DLLs are no longer imported from the PATH.
If gdalXXX.dll is in the PATH, then set the USE_PATH_FOR_GDAL_PYTHON=YES environment variable
to feed the PATH into os.add_dll_directory().
2021-04-01 16.36.32.155317  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A030064_20210325T112409_2021-03-25_con/RT_T29TNF_A030064_20210325T112409_B02.tif
2021-04-01 16.36.32.177264  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A030064_20210325T112409_2021-03-25_con/RT_T29TNF_A030064_20210325T112409_B03.tif
2021-04-01 16.36.32.204186  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A030064_20210325T112409_2021-03-25_con/RT_T29TNF_A030064_20210325T112409_B04.tif
2021-04-01 16.36.32.232111  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A030064_20210325T112409_2021-03-25_con/RT_T29TNF_A030064_20210325T112409_B05.tif
2021-04-01 16.36.32.259040  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A030064_20210325T112409_2021-03-25_con/RT_T29TNF_A030064_20210325T112409_B06.tif
2021-04-01 16.36.32.277988  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A030064_20210325T112409_2021-03-25_con/RT_T29TNF_A030064_20210325T112409_B07.tif
2021-04-01 16.36.32.294943  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A030064_20210325T112409_2021-03-25_con/RT_T29TNF_A030064_20210325T112409_B08.tif
2021-04-01 16.36.32.310965  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A030064_20210325T112409_2021-03-25_con/RT_T29TNF_A030064_20210325T112409_B11.tif
2021-04-01 16.36.32.328853  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A030064_20210325T112409_2021-03-25_con/RT_T29TNF_A030064_20210325T112409_B12.tif
2021-04-01 16.36.32.344810  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A030064_20210325T112409_2021-03-25_con/RT_T29TNF_A030064_20210325T112409_B8A.tif
2021-04-01 16.36.32.389814  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-populateTable 111   ERROR exception: list index out of range
2021-04-01 16.36.32.498594  SemiAutomaticClassificationPlugin.core.utils-createVirtualRaster 2614   virtual raster: D:/Temp/semiautomaticclassification/20210401_155448117873/20210401_163632423794576vrt_temp_.vrt
2021-04-01 16.37.09.228995  SemiAutomaticClassificationPlugin.core.utils-createRasterFromReference 3098 raster ['D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_163632509235920_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_163632509235921_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_163632509235922_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_163632509235923_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_163632509235924_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_163632509235925_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_163632509235926_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_163632509235927_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_163632509235928_temp.tif', 'D:/Temp/semiautomaticclassification/20210401_155448117873\\20210401_163632509235929_temp.tif']
2021-04-01 16.37.15.501239  SemiAutomaticClassificationPlugin.core.utils-multiProcessRaster 4788    start processRaster
2021-04-01 16.37.17.252604  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinelReflectance 337     ERROR exception: Traceback (most recent call last):
  File "C:\OSGeo4W\apps\Python39\lib\site-packages\osgeo\__init__.py", line 18, in swig_import_helper
    return importlib.import_module(mname)
  File "C:\OSGeo4W\apps\Python39\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 565, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1108, in create_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
ImportError: DLL load failed while importing _gdal: Impossível localizar o módulo especificado.

On Windows, with Python >= 3.8, DLLs are no longer imported from the PATH.
If gdalXXX.dll is in the PATH, then set the USE_PATH_FOR_GDAL_PYTHON=YES environment variable
to feed the PATH into os.add_dll_directory().
2021-04-01 16.37.17.270508  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A029921_20210315T112446_2021-03-15_con/RT_T29TNF_A029921_20210315T112446_B02.tif
2021-04-01 16.37.17.288460  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A029921_20210315T112446_2021-03-15_con/RT_T29TNF_A029921_20210315T112446_B03.tif
2021-04-01 16.37.17.304416  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A029921_20210315T112446_2021-03-15_con/RT_T29TNF_A029921_20210315T112446_B04.tif
2021-04-01 16.37.17.318378  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A029921_20210315T112446_2021-03-15_con/RT_T29TNF_A029921_20210315T112446_B05.tif
2021-04-01 16.37.17.334336  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A029921_20210315T112446_2021-03-15_con/RT_T29TNF_A029921_20210315T112446_B06.tif
2021-04-01 16.37.17.354282  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A029921_20210315T112446_2021-03-15_con/RT_T29TNF_A029921_20210315T112446_B07.tif
2021-04-01 16.37.17.373231  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A029921_20210315T112446_2021-03-15_con/RT_T29TNF_A029921_20210315T112446_B08.tif
2021-04-01 16.37.17.396045  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A029921_20210315T112446_2021-03-15_con/RT_T29TNF_A029921_20210315T112446_B11.tif
2021-04-01 16.37.17.414995  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A029921_20210315T112446_2021-03-15_con/RT_T29TNF_A029921_20210315T112446_B12.tif
2021-04-01 16.37.17.433944  SemiAutomaticClassificationPlugin.maininterface.sentinel2Tab-sentinel2 287  WARNING: unable to load rasterD:/Testes/SCP_Sentinel2//L2A_T29TNF_A029921_20210315T112446_2021-03-15_con/RT_T29TNF_A029921_20210315T112446_B8A.tif
2021-04-01 16.44.39.970560  SemiAutomaticClassificationPlugin.maininterface.settings-logCheckbox 142    LOG DISABLED

Full log: SCP_LOG.txt

semiautomaticgit commented 3 years ago

Thank you very much @PedroVenancio , I'll look into this

semiautomaticgit commented 3 years ago

Thank you @PedroVenancio it should be fixed in the Semi-Automatic Classification Plugin version 7.8.32