I am trying to run Polygonize (Raster to Vector)
from QGIS 3.18.3-Zürich inside a conda environment. When running the command, I encountered the following error.
Process gdal_polygonize.bat failed to start. Either gdal_polygonize.bat is missing, or you may have insufficient permissions to run the program.
I am able to load gdal from Python
(geoenv) C:\Users\jaina>python
Python 3.8.12 (default, Oct 12 2021, 03:01:40) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from osgeo import gdal
>>>
Also, gdalinfo
works fine. I tried adding gdal scripts directory to the PATH
C:\Users\jaina\.conda\envs\geoenv\Scripts
I also tried this answer to modify system settings in QGIS but it resulted in no module SIP
error on starting QGIS and processing tool bar disappears.
/Library/Frameworks/GDAL.framework/Programs:/Library/Frameworks/Python.framework/Versions/3.18.3/bin:
A similar question is unanswered here
EDIT:
Path to gdal_polygonize.bat
C:\Users\jaina\.conda\envs\geoenv>dir /s gdal_polygonize.bat
Volume in drive C is Windows
Volume Serial Number is 60CD-213A
File Not Found
Path to gdal_polygonize.py
C:\Users\jaina\.conda\envs\geoenv>dir /s gdal_polygonize.py
Directory of C:\Users\jaina\.conda\envs\geoenv\Lib\site-packages\GDAL-3.3.2-py3.8-win-amd64.egg-info\scripts
16-10-2021 15:38 330 gdal_polygonize.py
Directory of C:\Users\jaina\.conda\envs\geoenv\Lib\site-packages\osgeo_utils
01-10-2021 22:52 7,525 gdal_polygonize.py
Directory of C:\Users\jaina\.conda\envs\geoenv\Scripts
16-10-2021 15:38 210 gdal_polygonize.py
All paths for conda environment
(geoenv) C:\Users\jaina>set PATH
Path=C:\Users\jaina\.conda\envs\geoenv;C:\Users\jaina\.conda\envs\geoenv\Library\mingw-w64\bin;C:\Users\jaina\.conda\envs\geoenv\Library\usr\bin;C:\Users\jaina\.conda\envs\geoenv\Library\bin;C:\Users\jaina\.conda\envs\geoenv\Scripts;C:\Users\jaina\.conda\envs\geoenv\bin;C:\ProgramData\Miniconda3\condabin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Git LFS;C:\Program Files\dotnet;C:\Users\jaina\.conda\envs\geoenv\Scripts;C:\Users\jaina\AppData\Local\Microsoft\WindowsApps;.
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
gdal_polygonize.bat
is located on your computer using files search? Where is it? Do you have one file, more? Give us the list of paths.gdal_polygonize.bat
is not present inside my environment.