Is there any way to update Python on the Raspberry Pi (Wheezy) to Python 3.3?
Asked
Active
Viewed 1.6k times
15
-
1You probably don't want to change the default. Any system software that uses Python will probably break. You could add an alias for your account. Is typing python3 instead of python really so hard? – John La Rooy Apr 02 '13 at 04:45
-
1Do not change the default version unless you really need to, use virtualenv to create 'sanboxed' Python environments. You can install Python 3 into one of them without affecting any other projects that way. – phalt Apr 02 '13 at 07:21
1 Answers
17
You can install Python 3 easily:
$ sudo apt-get install python3
However: I wouldn't recommend settting this as the default version of Python.
If you're not already, starting using virtualenv, a tool for creating 'sandboxed' Python environments. Virtualenv will let you install multiple versions of Python without them conflicting with each other.
Installation is easy:
$ sudo pip install virtualenv
and creating a virtual environment in a folder is easy too:
$ virtualenv -p /usr/bin/python3 FOLDER
The -p flag tells you which version of Python to use. Then if you go into that folder:
$ cd FOLDER
you'll notice files like so:
$ ls
bin include lib
To activate this virtualenv type:
$ . bin/activate
The terminal line with change like so:
(FOLDER)$root@raspiberrypi: $
or something similar. The(FOLDER) part at the front tells you you're using the virtualenv.
To stop using that virtualenv just type:
deactivate

phalt
- 584
- 4
- 14
-
2How can this be an accepted answer? According to this answer there is no 3.3 version available for Wheezy. – Jim Aho Oct 13 '15 at 13:25
-
I wanted to ask if installing python3 with apt-get will also make it default or not – Pitto Dec 07 '15 at 15:43