在centos7上安装python(3.6)和gdal(2.4.4)环境

首先安装 gcc 

yum install gcc -y

将gcc升级到8

yum install centos-release-scl scl-utils-build

yum install -y devtoolset-8-toolchain

scl enable devtoolset-8 bash

安装python3-devel 

···

yum install python3-devel -y

···

下载解压gdal configu make make install 之后

设置环境变量

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/lib64

 python setup.py build

 python setup.py install

ln -s /usr/lib64/libproj.so.0 /usr/lib/libproj.so

进入python 试试

from osgeo import gdal 

 

ok!

你可能感兴趣的:(gis)