[gdal-dev] How to fix path for gdal .py scripts in Anaconda-Windows?

Rafael Lima raplima at hotmail.com
Wed Jan 12 10:24:43 PST 2022


## Expected behavior and actual behavior.

I installed gdal on a Windows environment using anaconda and tried using one of the .py scripts (e.g., ogrmerge.py). I expected the script to make use of the gdal installed in such an environment, but it seems that the script finds another gdal installation (screenshot below), thus throwing an error. My question seems to be related to the one in https://stackoverflow.com/questions/69328298/cannot-run-a-py-which-requires-a-gdal-module-in-anaconda-prompt-nor-in-command, apparently unsolved. I was wondering what is the correct approach to make sure gdal scripts find the correct gdal?

## Steps to reproduce the problem.
create a conda environment:
conda create -n test1 gdal
activate the environment
conda activate test1
call a gdal .py script
ogrmerge.py

In my case, that throws an error apparently because the script uses another gdal installation:
[cid:a82a3c37-9996-48fb-b90e-9267e1e33f1d]

## Operating system

Windows 10 Pro - 20H2 version

## GDAL version and provenance

GDAL==3.0.2
GDAL==3.4.0

Thank you!
Rafael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220112/59062bd9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 54185 bytes
Desc: image.png
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220112/59062bd9/attachment-0001.png>


More information about the gdal-dev mailing list