I have gdal installed and (I though) working fine. I use a lot rasterio and sometimes gdal directly, but today I wanted to do a mosaic and I wanted to try gdal_merge.py, but when I try to launch the tool I get this error message:

Traceback (most recent call last):
  File "C:\Anaconda3\Scripts\gdal_merge.py", line 4, in <module>
    __import__('pkg_resources').run_script('GDAL==2.1.1', 'gdal_merge.py')
  File "C:\pyqgis\lib\site-packages\pkg_resources\__init__.py", line 2927, in <module>
  File "C:\pyqgis\lib\site-packages\pkg_resources\__init__.py", line 2913, in _call_aside
    f(*args, **kwargs)
  File "C:\pyqgis\lib\site-packages\pkg_resources\__init__.py", line 2940, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "C:\pyqgis\lib\site-packages\pkg_resources\__init__.py", line 635, in _build_master
  File "C:\pyqgis\lib\site-packages\pkg_resources\__init__.py", line 943, in require
    needed = self.resolve(parse_requirements(requirements))
  File "C:\pyqgis\lib\site-packages\pkg_resources\__init__.py", line 829, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'GDAL==2.1.1' distribution was not found and is required by the application

I don't know what happens here. I try to run directly the gdal command line and I get one message saying I don't have osgeo installed (I actually have it). So I am pretty lost here. I have been reading a lot of post about gdal installation but I do the same I always see, and the proof is that I can work with gdal (from python or the cmd), but I don't realize where is my mistake.

  • 1
    what does gdalinfo --version say? – Ian Turton Jul 29 '16 at 12:36
  • Hi iant, "gdal 2.1.0 released 2016/04/25" – Digd Jul 29 '16 at 14:42
  • Remove currect 2.1.0 version then install the 2.1.1 – Balazs Jul 29 '16 at 15:22
  • The Python you are using thinks it is looking for 2.1.1 – Ian Turton Jul 29 '16 at 16:49
  • 1
    I'm pretty sure you have 2.1.1 installed in your Anaconda environment but an older 2.1 installed somewhere else (but present in the PATH). – Kersten Aug 4 '16 at 12:41

Your Answer

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

Browse other questions tagged or ask your own question.