Tested on Ubuntu 14.04.
Install desired version of python 3 (e.g. 3.5.1). Make sure to use the --enable-shared
flag to generate python shared libraries, which will later be linked to.
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.5.1