gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 13:19:30 25 4
gpt4 key购买 nike

我正在尝试按照几个指南和 StackOverflow 答案安装 GDAL ina virstualenvwrapper。

我在 ubuntu 13.04 上安装了 ligbdal1libgdal1-dev

在我的 virtualenv 中我试过:

pip install --no-install GDAL

...及之后:

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

但我得到这个错误:

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`

有什么建议吗?我可能哪里出错了?

最佳答案

看来 Ubuntu 13.04 上的 libgdal1 包已经过时了。Python cheeseshop(PyPi,pip 使用的是它)提供了一个 1.10.0 包装器,而 the 13.04 package list显示提供了 libgdal 版本 1.9.0。显然,在 1.10 中,引入了许多新函数,这些是您看到的“未声明”错误。

因此,有两个选择:

  • 手动安装 libgdal 1.10。在这种情况下,您可能可以对配置脚本使用 --with-python 选项,而无需安装单独的 Python 绑定(bind)。我猜你也会了解最新最好的。

  • 下载旧的 Python gdal 包装器 from the Python cheeseshop ,并从那里继续。这可能是最简单的选择。

关于python setup.py build_ext --include-dirs=/usr/include/gdal/不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19045596/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com