pyenv: BUILD FAILED (Ubuntu 15.04 using python-build 20160509)

The command pyenv install -v 2.7.11 gave me a similar error.

Installing the pyenv requirements solved my issue :

sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev

(See https://github.com/pyenv/pyenv/wiki/Common-build-problems)

Then :

pyenv install 2.7.11

To install python by using pyenv, the command pyenv install -v 2.7.11 could show more message than pyenv install 2.7.11. So it will be easy for me to locate the error. This time I got

curl: (77) error setting certificate verify locations: CAfile:
/etc/pki/tls/certs/ca-bundle.crt
CApath: none

This problem has already been solved in curl: (77) error

# sudo apt-get install ca-certificates

The issue was that curl expected the certificate to be at the path /etc/pki/tls/certs/ca-bundle.crt but could not find it because it was at the path /etc/ssl/certs/ca-certificates.crt.

Copying my certificate to the expected destination by running

sudo cp /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt

worked for me. You will need to create folders for the target destination if they do not exist by running

sudo mkdir -p /etc/pki/tls/certs

If needed, modify the above command to make the destination file name match the path expected by curl, i.e. replace /etc/pki/tls/certs/ca-bundle.crt with the path following "CAfile:" in your error message.