I am trying to upgrade Python 3 to the latest version on Debian Jessie, but I would like to keep system-installed Python 2 intact. By default, python
command executes Python v2, and python3
command executes Python v3.
python --version
Python 2.7.9
python3 --version
Python 3.4.2
If I install and switch to e.g. Python 3.6.3 using pyenv:
pyenv install 3.6.3
pyenv global 3.6.3
Now both python
and python3
point to v3.6.3.
python --version
Python 3.6.3
python3 --version
Python 3.6.3
How can I achieve that only python3
points to newly installed version, and python
keeps pointing to system installed Python v2?