1

Is it possible to have pyenv switch between two system versions of Python? I have recently installed Ubuntu 14.04 on my laptop, and it comes shipped with both python2 (v2.7.6) and python3 (v3.4.0) commands. (And the command python links to python2).

After installing pyenv, and typing pyenv versions it shows only one entry with * system, which is apparently the python2 version..

Do I need to install Python3 with pyenv, in order for it to be able to switch between Python2 and Python3? (I hope it is not necessary since I already have it installed)

Note: I know that I could just type python3 prog.py to run Python3, or I could insert an alias python=python3 in my ~/.bashrc but this is not what I am looking for. I am more interested to have programs with the #! /usr/bin/env python shebang to run with the Python3 interpreter..

1
  • I suspect you can do this in Ubuntu with update-alternatives. Commented Dec 22, 2014 at 13:28

1 Answer 1

3

There is a plugin just for this case: pyenv-register.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.