semiautomaticgit / SemiAutomaticClassificationPlugin

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

Python Error Lenovo #31

Closed corcork closed 6 years ago

corcork commented 6 years ago

I have had the following Python error with this Plugin while using two version of QGis. It happens when trying to define a new ROI. Please can you have a look and let me know what/where the issue is?

Thanks

Kate

An error has occurred while executing Python code:

ValueError: expected array of dim 2 Traceback (most recent call last): File "C:/Users/corco/.qgis2/python/plugins\SemiAutomaticClassificationPlugin\roidock\roidock.py", line 728, in pointerClickROI self.createROI(cfg.pntROI) File "C:/Users/corco/.qgis2/python/plugins\SemiAutomaticClassificationPlugin\roidock\roidock.py", line 328, in createROI oList = cfg.utls.rasterToBands(tR, cfg.tmpDir) File "C:/Users/corco/.qgis2/python/plugins\SemiAutomaticClassificationPlugin\core\utils.py", line 3257, in rasterToBands self.getRasterBandByBandNumber(rasterPath, x, xB, "No", None) File "C:/Users/corco/.qgis2/python/plugins\SemiAutomaticClassificationPlugin\core\utils.py", line 3227, in getRasterBandByBandNumber oRB.WriteArray(a) File "C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\osgeo\gdal.py", line 2452, in WriteArray callback_data = callback_data ) File "C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\osgeo\gdal_array.py", line 373, in BandWriteArray raise ValueError("expected array of dim 2") ValueError: expected array of dim 2

Python version: 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] QGIS version: 2.14.22-Essen Essen, 6af20113ec

Python Path: C:/PROGRA~1/QGIS2~1.14/apps/qgis-ltr/./python/plugins\processing C:/PROGRA~1/QGIS2~1.14/apps/qgis-ltr/./python C:/Users/corco/.qgis2/python C:/Users/corco/.qgis2/python/plugins C:/PROGRA~1/QGIS2~1.14/apps/qgis-ltr/./python/plugins C:\PROGRA~1\QGIS2~1.14\bin\python27.zip C:\PROGRA~1\QGIS2~1.14\apps\Python27\DLLs C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\plat-win C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\lib-tk C:\PROGRA~1\QGIS2~1.14\bin C:\PROGRA~1\QGIS2~1.14\apps\Python27 C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\win32 C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\win32\lib C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\Pythonwin C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\wx-2.8-msw-unicode C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg C:/Users/corco/.qgis2//python C:\PROGRA~1\QGIS2~1.14\apps\qgis-ltr\python\plugins\fTools\tools

semiautomaticgit commented 6 years ago

Thank you for reporting this. How did you install QGIS? Possibly some dependencies such as Python Numpy or Python Scipy are missing. You can try to install QGIS again.

semiautomaticgit commented 6 years ago

I close this because it should be solved in new version 6