Get the prefix for the virtualenv directory and the main python installation. Note that the pyenv commands are somewhat misleading.
PREFIX_MAIN=`pyenv virtualenv-prefix`
PREFIX_VENV=`pyenv prefix`
Download opencv and opencv_contrib into a clean directory. Make a separate build directory in same directory as opencv and opencv_contrib and enter it.