<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I’m trying to use the osgeo python module on an AWS EC2 instance (t3a.nano running Amazon Linux 2). From what I can gather I need to install the GDAL libraries, but am having a difficult time. When I try:<div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>python -m pip install GDAL</div><div class=""><br class=""></div><div class="">I get:</div><div class=""><br class=""></div><div class=""><div class=""> ERROR: Command errored out with exit status 1:</div><div class=""> command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-J58vPK/GDAL/setup.py'"'"'; __file__='"'"'/tmp/pip-install-J58vPK/GDAL/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-t20qWh</div><div class=""> cwd: /tmp/pip-install-J58vPK/GDAL/</div><div class=""> Complete output (50 lines):</div><div class=""> /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'long_description_content_type'</div><div class=""> warnings.warn(msg)</div><div class=""> running egg_info</div><div class=""> creating /tmp/pip-pip-egg-info-t20qWh/GDAL.egg-info</div><div class=""> writing requirements to /tmp/pip-pip-egg-info-t20qWh/GDAL.egg-info/requires.txt</div><div class=""> writing /tmp/pip-pip-egg-info-t20qWh/GDAL.egg-info/PKG-INFO</div><div class=""> writing top-level names to /tmp/pip-pip-egg-info-t20qWh/GDAL.egg-info/top_level.txt</div><div class=""> writing dependency_links to /tmp/pip-pip-egg-info-t20qWh/GDAL.egg-info/dependency_links.txt</div><div class=""> writing manifest file '/tmp/pip-pip-egg-info-t20qWh/GDAL.egg-info/SOURCES.txt'</div><div class=""> Traceback (most recent call last):</div><div class=""> File "<string>", line 1, in <module></div><div class=""> File "/tmp/pip-install-J58vPK/GDAL/setup.py", line 478, in <module></div><div class=""> setup(**setup_kwargs)</div><div class=""> File "/usr/lib/python2.7/site-packages/setuptools/__init__.py", line 129, in setup</div><div class=""> return distutils.core.setup(**attrs)</div><div class=""> File "/usr/lib64/python2.7/distutils/core.py", line 151, in setup</div><div class=""> dist.run_commands()</div><div class=""> File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands</div><div class=""> self.run_command(cmd)</div><div class=""> File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command</div><div class=""> cmd_obj.run()</div><div class=""> File "/usr/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 278, in run</div><div class=""> self.find_sources()</div><div class=""> File "/usr/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 293, in find_sources</div><div class=""> mm.run()</div><div class=""> File "/usr/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 524, in run</div><div class=""> self.add_defaults()</div><div class=""> File "/usr/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 560, in add_defaults</div><div class=""> sdist.add_defaults(self)</div><div class=""> File "/usr/lib/python2.7/site-packages/setuptools/command/py36compat.py", line 36, in add_defaults</div><div class=""> self._add_defaults_ext()</div><div class=""> File "/usr/lib/python2.7/site-packages/setuptools/command/py36compat.py", line 119, in _add_defaults_ext</div><div class=""> build_ext = self.get_finalized_command('build_ext')</div><div class=""> File "/usr/lib64/python2.7/distutils/cmd.py", line 312, in get_finalized_command</div><div class=""> cmd_obj.ensure_finalized()</div><div class=""> File "/usr/lib64/python2.7/distutils/cmd.py", line 109, in ensure_finalized</div><div class=""> self.finalize_options()</div><div class=""> File "/tmp/pip-install-J58vPK/GDAL/setup.py", line 320, in finalize_options</div><div class=""> self.gdaldir = self.get_gdal_config('prefix')</div><div class=""> File "/tmp/pip-install-J58vPK/GDAL/setup.py", line 263, in get_gdal_config</div><div class=""> raise gdal_config_error(traceback_string + '\n' + msg)</div><div class=""> __main__.gdal_config_error: Traceback (most recent call last):</div><div class=""> File "/tmp/pip-install-J58vPK/GDAL/setup.py", line 257, in get_gdal_config</div><div class=""> return fetch_config(option)</div><div class=""> File "/tmp/pip-install-J58vPK/GDAL/setup.py", line 160, in fetch_config</div><div class=""> raise gdal_config_error, e""")</div><div class=""> File "<string>", line 4, in <module></div><div class=""> gdal_config_error: [Errno 2] No such file or directory</div><div class=""> </div><div class=""> Could not find gdal-config. Make sure you have installed the GDAL native library and development headers.</div><div class=""> ----------------------------------------</div><div class="">ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.</div><div class=""><br class=""></div></div><div class=""><br class=""></div><div class="">So I’ve tried installing the GDAL libraries according to instructions on:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><a href="https://trac.osgeo.org/gdal/wiki/BuildingOnUnix" class="">https://trac.osgeo.org/gdal/wiki/BuildingOnUnix</a></div><div class=""><br class=""></div><div class=""><pre class="wiki" style="background-color: rgb(247, 247, 247); border: 1px solid rgb(215, 215, 215); box-shadow: rgb(238, 238, 238) 0px 0px 1em; border-top-left-radius: 0.3em; border-top-right-radius: 0.3em; border-bottom-right-radius: 0.3em; border-bottom-left-radius: 0.3em; margin: 1em 1.75em; padding: 0.25em; overflow: auto; font-size: 13px;">% cd gdal
% ./configure [options]
% make
% su
Password: ********
# make install
# exit</pre><div class=""><br class=""></div></div><div class="">When I run the ‘make’ command I get the following errors:</div><div class=""><br class=""></div><div class=""><div class="">libtool: compile: gcc -I/tmp/gdal-2.0.0/port -I/tmp/gdal-2.0.0/gcore -I/tmp/gdal-2.0.0/alg -I/tmp/gdal-2.0.0/ogr -I/tmp/gdal-2.0.0/ogr/ogrsf_frmts -g -O2 -Wall -Wdeclaration-after-statement -I/tmp/gdal-2.0.0/frmts/vrt -DOGR_ENABLED -I/tmp/gdal-2.0.0/port -DGDAL_COMPILATION -I/tmp/gdal-2.0.0/ogr/ogrsf_frmts/geojson/libjson -I/tmp/gdal-2.0.0/ogr/ogrsf_frmts/geojson -c gdalserver.c -fPIC -DPIC -o .libs/gdalserver.o</div><div class="">gdalserver.c: In function 'CreateSocketAndBindAndListen':</div><div class="">gdalserver.c:124:21: error: storage size of 'sHints' isn't known</div><div class=""> struct addrinfo sHints;</div><div class=""> ^~~~~~</div><div class="">gdalserver.c:126:31: error: invalid application of 'sizeof' to incomplete type 'struct addrinfo'</div><div class=""> memset(&sHints, 0, sizeof(struct addrinfo));</div><div class=""> ^~~~~~</div><div class="">gdalserver.c:129:23: error: 'AI_PASSIVE' undeclared (first use in this function); did you mean 'AF_WANPIPE'?</div><div class=""> sHints.ai_flags = AI_PASSIVE;</div><div class=""> ^~~~~~~~~~</div><div class=""> AF_WANPIPE</div><div class="">gdalserver.c:129:23: note: each undeclared identifier is reported only once for each function it appears in</div><div class="">gdalserver.c:132:12: warning: implicit declaration of function 'getaddrinfo' [-Wimplicit-function-declaration]</div><div class=""> nRet = getaddrinfo(NULL, pszService, &sHints, &psResults);</div><div class=""> ^~~~~~~~~~~</div><div class="">gdalserver.c:135:48: warning: implicit declaration of function 'gai_strerror'; did you mean 'strerror'? [-Wimplicit-function-declaration]</div><div class=""> fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(nRet));</div><div class=""> ^~~~~~~~~~~~</div><div class=""> strerror</div><div class="">gdalserver.c:135:42: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'int' [-Wformat=]</div><div class=""> fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(nRet));</div><div class=""> ~^ ~~~~~~~~~~~~~~~~~~</div><div class=""> %d</div><div class="">gdalserver.c:141:39: error: dereferencing pointer to incomplete type 'struct addrinfo'</div><div class=""> psResultsIter = psResultsIter->ai_next)</div><div class=""> ^~</div><div class="">gdalserver.c:162:5: warning: implicit declaration of function 'freeaddrinfo' [-Wimplicit-function-declaration]</div><div class=""> freeaddrinfo(psResults);</div><div class=""> ^~~~~~~~~~~~</div><div class="">gdalserver.c:124:21: warning: unused variable 'sHints' [-Wunused-variable]</div><div class=""> struct addrinfo sHints;</div><div class=""> ^~~~~~</div><div class="">make[1]: *** [gdalserver.lo] Error 1</div><div class="">make[1]: Leaving directory `/tmp/gdal-2.0.0/apps'</div><div class="">make: *** [apps-target] Error 2</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Any help would be greatly appreciated. </div><div class=""><br class=""></div><div class="">Lee</div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>