I need to build a pipeline which was written in python 2.7. A few dependencies like matplotlib have been upgraded since then to work with Python 3.x, but the original pipeline code is incompatible with python 3.x syntax. While building, I am unable to use Python 2.7 as matplotlib and thereby mayavi refuse to be installed after that. And if I build everything using Python 3.x the final code does not execute because the code is incompatible with python 3.x.
Please help.
31 Answer
You can use pyenv to switch between python versions.
# Get Pyenv curl -L | bash # add pyenv to ~/.bashrc echo -e "export PATH="/root/.pyenv/bin:$PATH" \n eval "$(pyenv init -)" \n eval "$(pyenv virtualenv-init -)" " >> ~/.bashrc source ~/.bashrc # install python 3 via pyenv pyenv install 3.5.6 # verify pyenv versions # pyenv local <version> : use this to set python version per directory. # pyenv gloal <version> : use this to set python version globally.