Hello everyone,

I am developing a new QGIS plugin 
(https://plugins.qgis.org/plugins/whitebox_workflows_for_qgis/#plugin-manage) 
that serves as a frontend for a Python geospatial analysis library called 
Whitebox Workflows for Python (WbW). The plugin seems to work well with on 
major exception, it requires that the user have WbW installed. It can be 
installed quite easily using pip (pip install whitebox-workflows), however, I 
know that QGIS uses its own localized version of Python, which seems to lack a 
terminal app access (at least on MacOS). Besides, a better solution would be 
for the plugin to install this package via pip when it is itself first 
installed and launched. I tried to accomplish this with the following code:

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

This code, which runs whenever the plugin is launched, first checks to see if 
whitebox_workflows can be imported and if not, it runs pip from the Python 
script to install it. Unfortunately, some users have reported issues with this 
not working correctly:

https://github.com/jblindsay/whitebox_workflows_for_qgis/issues/1

[https://opengraph.githubassets.com/a248a1a51b43baa531f4fdf47f85868a01c5785c3dded22234ce269d2c64c9e4/jblindsay/whitebox_workflows_for_qgis/issues/1]<https://github.com/jblindsay/whitebox_workflows_for_qgis/issues/1>
Installation in QGis fails · Issue #1 · 
jblindsay/whitebox_workflows_for_qgis<https://github.com/jblindsay/whitebox_workflows_for_qgis/issues/1>
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_work...
github.com

So now I'm left trying to figure out what the recommended approach to 
installing QGIS plugin dependencies is. Any advice from anyone that has 
successfully dealt with this problem previously? Thanks.

Regards,

John Lindsay



Prof. John Lindsay

Dept. of Geography, Environment & Geomatics,

The University of Guelph,

Room 122, Hutt Building,

E-mail: jlind...@uoguelph.ca

Phone: (519) 824-4120 ext. 56074

Web: https://geg.uoguelph.ca/faculty/lindsay-john

Research page: https://jblindsay.github.io/ghrg/index.html

WhiteboxTools GIS project: https://www.whiteboxgeo.com/

Twitter: https://twitter.com/whiteboxgeo
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to