我一直在安装GeoDjango,我在安装GDAL library
时遇到了问题。我正在运行ubuntu 16.04
并且我安装了GEOS
和PROJ.4
,我正在使用PostGIS
安装。我以前有一个版本的python 3.5
安装并经过卸载它,看看是否解决了这个问题。在make上我收到以下错误:
/home/matt/geodjango/gdal-1.11.2/.libs/libgdal.so: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()'
/home/matt/geodjango/gdal-1.11.2/.libs/libgdal.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char, unsigned long) const'
collect2: error: ld returned 1 exit status
GNUmakefile:46: recipe for target 'gdalinfo' failed
make[1]: *** [gdalinfo] Error 1
make[1]: Leaving directory '/home/matt/geodjango/gdal-1.11.2/apps'
GNUmakefile:69: recipe for target 'apps-target' failed
make: *** [apps-target] Error 2
我找到Converting std::__cxx11::string to std::string,但我不确定如何实施此解决方案。还有其他建议可以成功安装GDAL吗?
答案 0 :(得分:1)
我试过了:
pip install gdal
失败了:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-yOu25c/gdal/
和
easy_install gdal
失败了:
setuptools.sandbox.UnpickleableException: gdal_config_error(OSError(2, 'No such file or directory'),)
我能够跑:
conda install gdal
工作并返回true:
>>> from django.contrib.gis import gdal
>>> gdal.HAS_GDAL
true
答案 1 :(得分:0)
postgis 和 GDAL 可以直接从ubuntu的repositories安装:
sudo apt-get install postgis