Closed monodo closed 7 years ago
QGIS 2.12 x64 test give me
Une erreur est apparue lors de l'exécution du code Python :
AttributeError: 'NoneType' object has no attribute 'GetLayer' Traceback (most recent call last): File "C:/OSGEO4~1/apps/qgis/./python/plugins\forLim\forLim.py", line 689, in run lyr = ds.GetLayer() AttributeError: 'NoneType' object has no attribute 'GetLayer'
Version de Python : 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] Version de QGIS : 2.12.0-Lyon Lyon, cd9d645
Chemin Python : C:/Users/Nono/.qgis2/python/plugins\processing C:/OSGEO4~1/apps/qgis/./python C:/Users/Nono/.qgis2/python C:/Users/Nono/.qgis2/python/plugins C:/OSGEO4~1/apps/qgis/./python/plugins C:\OSGEO4~1\apps\Python27\lib\site-packages\matplotlib-1.3.1-py2.7-win-amd64.egg C:\OSGEO4~1\apps\Python27\lib\site-packages\nose-1.3.3-py2.7.egg C:\OSGEO4~1\apps\Python27\lib\site-packages\tornado-4.0.1-py2.7-win-amd64.egg C:\OSGEO4~1\apps\Python27\lib\site-packages\backports.ssl_match_hostname-3.4.0.2-py2.7.egg C:\OSGEO4~1\apps\Python27\lib\site-packages\certifi-14.05.14-py2.7.egg c:\osgeo4~1\apps\python27\lib\site-packages\python_dateutil-2.1-py2.7.egg c:\osgeo4~1\apps\python27\lib\site-packages\six-1.3.0-py2.7.egg C:\OSGEO4~1\bin\python27.zip C:\OSGEO4~1\apps\Python27\DLLs C:\OSGEO4~1\apps\Python27\lib C:\OSGEO4~1\apps\Python27\lib\plat-win C:\OSGEO4~1\apps\Python27\lib\lib-tk C:\OSGEO4~1\bin C:\OSGEO4~1\apps\Python27 C:\OSGEO4~1\apps\Python27\lib\site-packages C:\OSGEO4~1\apps\Python27\lib\site-packages\PIL C:\OSGEO4~1\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg C:\OSGEO4~1\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg C:\OSGEO4~1\apps\Python27\lib\site-packages\pytz-2012j-py2.7.egg C:\OSGEO4~1\apps\Python27\lib\site-packages\win32 C:\OSGEO4~1\apps\Python27\lib\site-packages\win32\lib C:\OSGEO4~1\apps\Python27\lib\site-packages\Pythonwin C:\OSGEO4~1\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg C:\OSGEO4~1\apps\Python27\lib\site-packages\wx-2.8-msw-unicode C:\OSGEO4~1\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg C:\OSGEO4~1\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg C:/Users/Nono/.qgis2//python C:\Users\Nono.qgis2\python\plugins\DigitizingTools\tools C:\OSGEO4~1\apps\qgis\python\plugins\fTools\tools
Have you checked that the runalg result is not empty ? If yes, I would check paths and algorithm availability in x64 (if the problem occurs only in x64). Generally speaking, I would recommend not to use runalg stuff if possible.
The error does not come out of the QGIS version, I have it on all my QGIS instances (x32/x64). This works fine on Marie's Computer (2.10.1 x64). We have same version of the plugin, which means that I have an issue with paths / alg availability.
What debug tool do you recommend for such programming tasks?
Well, on windows as least, setting up a proper IDE is really, really not straightforward. You can check this link and/or ask the QGIS developpers on the mailing list.
But once you get used to the QGIS API it's quite easy to debug using print in your code and check the value of your variable of intererst in the QGIS python console where prints appear.
Please run a test calculation on QGIS Lyon (2.12). The plugin loads well but I did not try to run a calculation