jblindsay / whitebox_workflows_for_qgis

A QGIS frontend for Whitebox Workflows for Python
GNU General Public License v3.0
3 stars 0 forks source link

Installation in QGis fails #1

Closed ThomasStruller closed 5 months ago

ThomasStruller commented 6 months ago

AttributeError: 'NoneType' object has no attribute 'write' Traceback (most recent call last): File "C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\whitebox_workflows_for_qgis\whitebox_workflows_for_qgis_provider.py", line 56, in init import('whitebox_workflows') File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ModuleNotFoundError: No module named 'whitebox_workflows'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 448, in startPlugin plugins[packageName].initGui() File "C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\whitebox_workflows_for_qgis\whitebox_workflows_for_qgis.py", line 57, in initGui self.initProcessing() File "C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\whitebox_workflows_for_qgis\whitebox_workflows_for_qgis.py", line 53, in initProcessing self.provider = WhiteboxWorkflowsProvider() File "C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\whitebox_workflows_for_qgis\whitebox_workflows_for_qgis_provider.py", line 60, in init pip.main(['install', 'whitebox-workflows']) File "C:\OSGeo4W\apps\Python39\lib\site-packages\pip__init__.py", line 13, in main return _wrapper(args) File "C:\OSGeo4W\apps\Python39\lib\site-packages\pip_internal\utils\entrypoints.py", line 35, in _wrapper sys.stderr.write( AttributeError: 'NoneType' object has no attribute 'write'

Python-Version: 3.9.18 (heads/master:c290dc6, Jan 14 2024, 01:36:02) [MSC v.1929 64 bit (AMD64)] QGIS-Version: 3.34.2-Prizren Prizren, 7d199797fc

Python-Pfad: C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ThToolBox C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ProcessX C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\postgis_toolbox C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\pdaltools C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour C:/OSGeo4W/apps/qgis/./python C:/Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:/Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins C:/OSGeo4W/apps/qgis/./python/plugins C:\OSGeo4W\apps\grass\grass83\etc\python C:\Users\thomas.struller\Documents C:\OSGeo4W\bin\python39.zip C:\OSGeo4W\apps\Python39\DLLs C:\OSGeo4W\apps\Python39\lib C:\OSGeo4W\bin C:\OSGeo4W\apps\Python39 C:\OSGeo4W\apps\Python39\lib\site-packages C:\OSGeo4W\apps\Python39\lib\site-packages\win32 C:\OSGeo4W\apps\Python39\lib\site-packages\win32\lib C:\OSGeo4W\apps\Python39\lib\site-packages\Pythonwin C:/Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:\Users\thomas.struller\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\DigitizingTools\tools C:\Users\thomas.struller\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\DigitizingTools C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_resource_sharing C:\Users\thomas.struller\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis_resource_sharing C:\Users\thomas.struller\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis_resource_sharing\ext_libs C:\Users\thomas.struller\AppData\Roaming\QGIS\QGIS3\profiles\default\python\site-packages W:/qgis

jblindsay commented 6 months ago

Thanks for taking the time to report this error and it is very helpful. That is a strange error for sure. It's clear that No module named 'whitebox_workflows' would indicate that it is unable to find the Whitebox Workflows library installed. When the frontend first loads, it tries to import the Whitebox Workflows library to see if it's installed right here:

https://github.com/jblindsay/whitebox_workflows_for_qgis/blob/4e463262f6cfd1987afa2f3f7e0e79656eb8d27e/whitebox_workflows_for_qgis_provider.py#L56

If it is unable to find the library installed, it then tries to install it using pip, here:

https://github.com/jblindsay/whitebox_workflows_for_qgis/blob/4e463262f6cfd1987afa2f3f7e0e79656eb8d27e/whitebox_workflows_for_qgis_provider.py#L60

Given this first test is contained within a 'try' block, I'm admittedly confused as to why this is not working. Can I ask, does the frontend not load at all for you then? Can you see the tools at all? If so, can any of them run for you, or do you not see the frontend at all?

ThomasStruller commented 6 months ago

Hallo,

thank you for your answer.

I don't see the frontend at all. I see the whitebox workflow marked below extensions, get the delivered error message ... thats it. No frontend, nothing.

Mit freundlichem Gruß

Thomas Struller Schloßhofstraße 11 90571 Schwaig b. Nürnberg T: +49 1070 33 20 494 @.***

Am 19.01.2024 um 13:35 schrieb John Lindsay:

Thanks for taking the time to report this error and it is very helpful. That is a strange error for sure. It's clear that |No module named 'whitebox_workflows'| would indicate that it is unable to find the Whitebox Workflows library installed. When the frontend first loads, it tries to import the Whitebox Workflows library to see if it's installed right here:

https://github.com/jblindsay/whitebox_workflows_for_qgis/blob/4e463262f6cfd1987afa2f3f7e0e79656eb8d27e/whitebox_workflows_for_qgis_provider.py#L56

If it is unable to find the library installed, it then tries to install it using pip, here:

https://github.com/jblindsay/whitebox_workflows_for_qgis/blob/4e463262f6cfd1987afa2f3f7e0e79656eb8d27e/whitebox_workflows_for_qgis_provider.py#L60

Given this first test is contained within a 'try' block, I'm admittedly confused as to why this is not working. Can I ask, does the frontend not load at all for you then? Can you see the tools at all? If so, can any of them run for you, or do you not see the frontend at all?

— Reply to this email directly, view it on GitHub https://github.com/jblindsay/whitebox_workflows_for_qgis/issues/1#issuecomment-1900338341, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMW7ELIY55L6HLR3ONV6QDTYPJSB7AVCNFSM6AAAAABCBWVEISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBQGMZTQMZUGE. You are receiving this because you authored the thread.Message ID: @.***>

jblindsay commented 5 months ago

Okay, I've just released v1.0 of this plugin, which should resolve this issue. I'm closing it now, but please feel free to re-open it if you encounter this issue after updating the plugin. Thank you once again for reporting this.