-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Processing] gdal gives no output in standalone script #38036
Comments
@jfbourdon you should ask in the users or developers mailing list and check if your script is ok. |
@jfbourdon Have you solved this problem and could you share your experience ? |
I haven't solved this yet... I rather avoided the problem by only running my scripts with the GUI and/or by directly calling GDAL executables with |
The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". |
As a follow-up, I'm still unable to call any |
I have a similar problem. I do not want any workarounds. I want this issue to be solved. It is still occurring in QGIS 3.16 and QGIS 3.18 |
@naf140230 if you "want" a fix then look here https://qgis.org/en/site/forusers/commercial_support.html |
From a brief glance of the URL, I can see that there are many groups who contributed to QGIS. I will take a more thorough look soon. In the meantime, do you have any recommendations on which specific ones might have the solution I need or at least whom I could inform of the problem? |
Have you gotten any further with this? I've got the same issue. |
I found a work-around that I am currently using. |
Right now, I would like to know a workaround for a SAGA tool that does not work with processing.run. This is a Raster Calculator tool that SAGA provides, and it does not work in standalone with processing.run, unless I am running it from the Python Console within QGIS. |
@naf140230 completely unrelated to this ticket. Anyway, are you on macOS? |
No, I am on Windows, and I ended up solving that problem using a similar workaround to the gdal problem. |
I have also encountered this issue. It seems to me that in this example the processing algorithm gdal:polygonize executes the command Getting beyond my skills but my guess the system can't find the python file gdal_polygonize.py in the path. This looks like it may have been fixed by detecting windows installs and executing the .bat to correctly configure the environment. |
Encountered this issue today, and accidently solved the problem now. e.g., in my case, os.environ['OSGEO4W_ROOT'] =r"C:\Program Files\QGIS 3.34.0" I randomly tested calling the command directly in Jupyter. I noticed the path to the .bat has not been cooreclty assigned.
Then I look up to the 'gdal_polygonize.bat', finding out it relies on %OSGEO4W_ROOT% to correctly call the .py And then I realized I haven't defined os.environ['OSGEO4W_ROOT'] aside from the environment varials like PATH and PYTHONPATH. |
Describe the bug
I'm unable to use any GDAL algorithm in a standalone script (QGIS 3.12.1 on Windows 10). All
processing.run(native: )
andprocessing.run(saga: )
algorithms work without any problem, but when using aprocessing.run(gdal: )
algorithms, I only get an empty result (no error). However, the sameprocessing(gdal: )
algorithm works when I'm using the python console within QGIS.Thinking that it may be related to environment variables, I used
os.environ
inside QGIS' python console to see what variables were loaded, then loaded the exact same ones in my standalone script but it didn't work. I asked for help on SO some time ago got no answer.How to Reproduce
Create a py file, change the
inpath
andoutpath
variables and run it with QGIS' python (note that the paths are with an OSGeo4W64 installation atC:/OSGeo4W64
):QGIS and OS versions
QGIS 3.12.2-București
QGIS code revision 8a1fb33
Compiled against Qt 5.11.2
Windows 10 (10.0)
The text was updated successfully, but these errors were encountered: