2013-09-27 2 views
3

여러 안내선과 StackOverflow 답변에 따라 virstualenvwrapper에 GDAL을 설치하려고합니다.python setup.py build_ext --include-dirs =/usr/include/gdal/not work

pip install --no-install GDAL 

... 후에 :

python setup.py build_ext --include-dirs=/usr/include/gdal/ 

는하지만이를 얻을

나는 나는 것을 시도 내 VIRTUALENV 내부 ligbdal1libgdal1-dev

을 istalled 우분투 13.04에있어 오류 :

running build_ext 
building 'osgeo._gdal' extension 
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/gdal/ -I/usr/include/python2.7 -I/home/envs/test/local/lib/python2.7/site-packages/numpy/core/include -I/usr/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o 
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default] 
extensions/gdal_wrap.cpp: In function ‘int PyProgressProxy(double, const char*, void*)’: 
extensions/gdal_wrap.cpp:3237:2: warning: the address of ‘_Py_NoneStruct’ will never be NULL [-Waddress] 
extensions/gdal_wrap.cpp: In function ‘int GDALTransformerInfoShadow_TransformGeolocations(GDALTransformerInfoShadow*, GDALRasterBandShadow*, GDALRasterBandShadow*, GDALRasterBandShadow*, GDALProgressFunc, void*, char**)’: 
extensions/gdal_wrap.cpp:5010:69: error: ‘GDALTransformGeolocations’ was not declared in this scope 
extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GOA2GetAuthorizationURL(PyObject*, PyObject*)’: 
extensions/gdal_wrap.cpp:5553:79: error: ‘GOA2GetAuthorizationURL’ was not declared in this scope 
extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GOA2GetRefreshToken(PyObject*, PyObject*)’: 
extensions/gdal_wrap.cpp:5606:94: error: ‘GOA2GetRefreshToken’ was not declared in this scope 
extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GOA2GetAccessToken(PyObject*, PyObject*)’: 
extensions/gdal_wrap.cpp:5661:93: error: ‘GOA2GetAccessToken’ was not declared in this scope 
extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_ReadDirRecursive(PyObject*, PyObject*)’: 
extensions/gdal_wrap.cpp:6081:61: error: ‘VSIReadDirRecursive’ was not declared in this scope 
extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_MajorObject_SetMetadata__SWIG_0(PyObject*, PyObject*)’: 
extensions/gdal_wrap.cpp:7501:31: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] 
extensions/gdal_wrap.cpp: In function ‘int GDALTransformerInfoShadow_TransformGeolocations(GDALTransformerInfoShadow*, GDALRasterBandShadow*, GDALRasterBandShadow*, GDALRasterBandShadow*, GDALProgressFunc, void*, char**)’: 
extensions/gdal_wrap.cpp:5011:3: warning: control reaches end of non-void function [-Wreturn-type] 
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1` 

제안 사항이 있으십니까? 내가 어디로 잘못 가고 있을까?

답변

7

우분투 13.04의 libgdal1 패키지가 이미 구식 인 것으로 보입니다. Python cheeseshop (pip가 사용하는 PyPi)은 1.10.0 래퍼를 제공하고 the 13.04 package list은 libgdal 버전 1.9.0이 제공된다는 것을 보여줍니다. 분명히, 1.10에서, 당신이보고있는 "선언되지 않은"오류 인 많은 새로운 기능이 소개되었습니다.

따라서, 두 가지 옵션 :

  • 수동으로 1.10 libgdal를 설치합니다. 이 경우 configure 스크립트에 --with-python 옵션을 사용할 수 있으며 별도의 Python 바인딩을 설치할 필요가 없습니다. 당신은 또한 가장 최신이고 가장 위대한 것 같아요.

  • 구형 파이썬 gdal 래퍼 from the Python cheeseshop을 다운로드하고 거기에서 계속하십시오. 아마 가장 쉬운 방법 일 것입니다.

+0

두 번째 옵션을 사용했습니다. 더 간단합니다 ... 작동합니다 .. 고마워요. –

+1

@ user566663 당신은 응답자가 미래의 방문자를 도울 수 있도록 '답변 됨'으로 표시 할 수 있으므로 작동하는 해결책이 있음을 알 수 있습니다 (글쎄, 적어도 당신에게는 좋지만 아마도 더 많은 사람들). – Evert

+0

고마워요, 저를 길에 태워주세요! 물론 버전 미스 매치! 저에게는 파이썬 gdal 1.11.x와 gdal 1.10.x가 있습니다. –

관련 문제