I can easily install GDAL and Python bindings on a Windows machine, but I can not reproduce the same thing on a CentOS machine. The problem is I want to use Python 3.4 (Python 2.7 is too old and outdated for me). So, I have two versions of Python on my CentOS machine and if I do
# update-alternatives --config python
I see such a picture:
+ 1 /usr/bin/python2.7
* 2 /usr/bin/python3.4
So, Python 2.7 is now active and when I do this:
# yum install gdal-python
everything works ok, except one little fact – gdal is installed for Python 2.7. If however, I switch to Python 3.4 and run the same command, I see multiple errors in the console, like
except OSError, e:
SyntaxError: invalid sytax
I do not know what to do with all this. What I want is just to be able to use gdal with Python 3.4.
Best Answer
Here are two ways I have accomplished this using pip (if you do not have pip you must first do
yum install python3-pip
.