1

I just installed Ubuntu 12.04 and Python 2.7 is pre-installed. I want also to have 3.2, and to be able to select one as the default with no arguments and the other to be specified by command line argument.

I guess I'm asking how to set environment variables analogous to PATH in Windows7, right?

BioGeek
  • 582
  • 2
  • 9
  • 20

1 Answers1

5

It's impossible to use the command python using python3.2 because Ubuntu uses python2.7. You can try using #!/usr/bin/python3 in that first line of your python code to use python3.2.

To install python3.2 in Ubuntu:

Go to the console and put this:

sudo apt-get update && sudo apt-get install python3

After that, go to the console and enter python3. This will be python3.2 and python will be python 2.7.

slhck
  • 223,558
  • 70
  • 607
  • 592
matheus
  • 76
  • 3
  • sorry I hadn't gotten around to `accepting` the answer until today. i just received a notification that it was a `notable question`. strange, but okay! – Wylie Кулик Jul 14 '13 at 09:29