gdal_merge.py not working after gdal and it python bindings have been installed
Question: I installed Python 3.4.0 64 bit and gdal file
release-1400-x64-gdal-1-11-1-mapserver-6-4-1.zip from
<http://www.gisinternals.com/release.php>. I found the binding from
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal> and the filename is
GDAL-1.11.2-cp34-none-win_amd64. I successfully install these files and import
gdal. However, when I run the following command within the Python IDE to merge
files 1 2 and 3, I got an error

    
    
     >>> gdal_merge.py -o out.tif 1.tif 2.tif 3.tif
      File "<console>", line 1
       gdal_merge.py -o out.tif 1.tif 2.tif 3.tif
                       ^
     SyntaxError: invalid syntax
    

I specifically check to see if I can import gdal_merge as below

    
    
    >>> import gdal_merge
    

and it was ok. I appreciate if anybody could help with this issue.


Answer: `gdal_merge.py` is part of the [GDAL
utilities](http://www.gdal.org/gdal_utilities.html) which are executed from
the command line, not from within a Python IDE or another Python script.

Just open a command line (`cmd`) and type:

    
    
    python gdal_merge.py -o out.tif 1.tif 2.tif 3.tif
    

Depending on your environment variables and whether you included GDAL in your
Path variable you might need to specificy the full path to `gdal_merge.py`
and/or can leave out `python` at the beginning of the call.

