2

I try to follow this guide ► Creating super-overlays with gdal2tiles, everything goes well until it reachs gdal2tiles part.

When I type the command gdal2tiles.py -p geodetic -k bluemarble2.vrt or gdal2tiles.py or gdal2tiles in OSGeo4W Shell it gives following result:

'gdal2tiles' is not recognized as an internal or external command, operable program or batch file.

I tried almost everything, searched Google for 2 days, added paths in Windows Environment Variables, installed-uninstalled separate OSGeo4W, experimented with different python versions. And still no any improvement.

Details: At the moment my OSGeoW4 (path: "C:\Program Files\QGIS 3.12\OSGeo4W.bat") is the one which comes with QGIS 3.12, and this installation has its own Python 3.7 (path: "C:\Program Files\QGIS 3.12\apps\Python37\python.exe") as well.

As google searching showed I am not the only one who has such problem, so does anyone know how to solve this issue?

► UPDATE [08:20 2020-06-18]

After @ian-turton's answer I've installed python bindings, but now when I run the command gdal2tiles.py -p geodetic -k bluemarble2.vrt it opens actual python file gdal2tiles.py in my VS Code editor.

python bindings

Shell and VS Code

3
  • did you install the gdal-python bindings? I don't think they are on by default – Ian Turton Jun 18 '20 at 8:23
  • I installed them on separate OSGeoW4 and had no success in solving the issue. Anyway I will do it again in this directory. – Dan Jun 18 '20 at 8:28
  • You should only have (and need) one OSGEO4W install – Ian Turton Jun 18 '20 at 8:28
2

You need to install the python bindings for GDAL.

The easiest way is to use the Osgeo4w installer and make sure to check the gdal-python box in the installer.

You need to use the advanced install option and expand the libs item to find gdal-python.

enter image description here

0
0

Just run py3_env first, then everything is fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.