The scenario is, you're on the latest and greatest python version (3.7 in my case) and you need to install an earlier version (default ubuntu at this time is 3.5.2). When you try to do this through pyenv you get the following error:
Last 10 log lines:
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
clang -c -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Werror=declaration-after-statement -I. -IInclude -I./Include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -I/Users/sstults/.pyenv/versions/3.5.2/include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -I/Users/sstults/.pyenv/versions/3.5.2/include -DPy_BUILD_CORE -o Python/frozen.o Python/frozen.c