When I try to install gdal (on OSX 10.11.6) with pip install gdal
(or easy_install) the installation fails with following error
extensions/gdal_wrap.cpp:3085:10: fatal error: 'cpl_port.h' file not found
#include "cpl_port.h"
According to this thread https://stackoverflow.com/questions/37700484/python-gdal-does-not-install-on-mac-osx-el-capitan I added the location of the header file to my path variable. My .bash_profile now looks like this
export PATH=$PATH:/Library/Frameworks/GDAL.framework/Programs
export PATH=$PATH:/Library/Frameworks/GDAL.framework/Headers
The error remains the same.
Then I tried following this solution: Python GDAL package missing header file when installing via pip although I do not want to install it in a virtualenv.
After setting CPLUS_INCLUDE_PATH
and C_INCLUDE_PATH
I ran into following error:
clang++ -bundle -undefined dynamic_lookup -Wno-error=unused-command-line-argument-hard-error-in-future build/temp.macosx-10.11-x86_64-2.7/extensions/gdal_wrap.o -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -L/Library/Frameworks/GDAL.framework/Versions/2.1/lib -lgdal -o build/lib.macosx-10.11-x86_64-2.7/osgeo/_gdal.so
ld: warning: directory not found for option '-L/Library/Frameworks/GDAL.framework/Versions/2.1/lib'
ld: library not found for -lgdal
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang++' failed with exit status 1
Any idea how to fix the errors and get a working installation?
gdal2tiles.py
which seems executable put gives me the errorImportError: No module named osgeo
- any ideas? – Strernd Mar 27 '17 at 16:07