Here will be my sequence of command lines while trying to install gdal2.1 in a UBUNTU virtual machine. My virtual machine is a UBUNTU 16.04 LTS(64bit) I would need gdal2.1 a
Did you install python-dev ?
python-dev
Before you install anything from source in Ubuntu, I suggest you take care of the build dependencies.
sudo apt-get build-dep python-gdal
Than try and run the installation.