0

The problem is that within the PyCharm editor, the gdal applications (e.g. gdalwarp or gdal_grid https://gdal.org/) cannot be found when using os.system. For example the code:

os.system(f"gdalwarp -t_srs EPSG:27700 {fnc} {tname}")

returns this error message 'sh: 1: gdalwarp: not found'.

I am using PyCharm interpreter with the following settings:

  • Ubuntu WSL platform
  • conda environment with gdal libaries installed.

When I run the code from the ubuntu terminal, it does find the gdal libraries. So I don't think the problem is within the conda environment, but there is a problem with PyCharm settings to find the gdal application using os system.

I do not want to change the code, but I would rather figure out the correct PyCharm settings. Any help would be greatly appreciated.

0 Answers0