How to make side-by-side Python 2.7 and 3.2 installs on Ubuntu 12.04,
5,195
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
.
Related videos on Youtube
Author by
Wylie Кулик
Updated on September 18, 2022Comments
-
Wylie Кулик over 1 year
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?
-
Wylie Кулик almost 11 yearssorry I hadn't gotten around to
accepting
the answer until today. i just received a notification that it was anotable question
. strange, but okay!