Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im using 13.04 but I want have installed the both main Python versions for make tests about migration of my actual code.

is possible install Python 3 in the same machine running Python 2.7? I need work with both versions,thanks!

share|improve this question
up vote 25 down vote accepted

Yes, you just need to install python3 package.

$ sudo apt-get install python3

Python 2.X will still be the default Python used, so if you want to run a script with Python 3.X you need to run

$ python3 /path/to/

or add in the first line of your executable script:

#!/usr/bin/env python3
share|improve this answer
I search a lot and only found information about how to install Python 3 but nothing about if my dev environment is safe with both versions running. Thanks! – mlacunza Sep 27 '13 at 15:39
@mlacunza If you install both from the default repositories (ex: with apt-get, Software Center) you will have no problem at all. But if you install from source, depending on where it ends installed and if it replaces the default python installation you can have some problems. – Salem Sep 28 '13 at 12:21
@mlacunza If this answered your question, mark it as answered. – Salem Oct 7 '13 at 13:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.