ruth
Posts: 3
Joined: Mon Jun 04, 2012 7:22 am

Can I install Python v3?

Thu Jun 14, 2012 8:16 am

Can anyone tell me if I can install Python version 3 on the Raspberry Pi? I have bought my 12 year old son a beginners guide to Python and it is written for version 3 point something. I suppose the first question should be is there a big difference between the 2 versions ie will the book I've bought be any use for version 2.6 already on the Pi. And the secondly, will the Pi run a later version of Python? If so is it easy to download (have seen downloads on python site)? :shock:

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Can I install Python v3?

Thu Jun 14, 2012 9:19 am

I,m sure you can, from the command line it'll be something like
sudo apt-get install python3.1


Actually, there is a help guide in this thread :

http://www.raspberrypi.org/phpBB3/viewt ... =32&t=4766


Let us know how you get on.
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Bellagio
Posts: 19
Joined: Tue Jun 12, 2012 3:23 pm

Re: Can I install Python v3?

Thu Jun 14, 2012 9:25 am

On raspbian, Python3.2 is available with aptitude or apt-get.
A simple:

Code: Select all

aptitude install python3.2
should be well

ruth
Posts: 3
Joined: Mon Jun 04, 2012 7:22 am

Re: Can I install Python v3?

Fri Jun 15, 2012 4:01 pm

texy wrote:I,m sure you can, from the command line it'll be something like
sudo apt-get install python3.1


Actually, there is a help guide in this thread :

http://www.raspberrypi.org/phpBB3/viewt ... =32&t=4766


Let us know how you get on.
Texy
Thank you. I used sudo apt-get install python3.1 and it worked! I still have Python2.6 installed. My son's been using Geany as his editor. do you know if you have to do anything to Geany so it knows to run your scripts in Python 3.1 rather than 2.6? We till have 2.6 installed. Maybe that needs uninstalling? Do you know how?
Ruth

sharpapotheosis
Posts: 58
Joined: Thu May 24, 2012 6:47 pm

Re: Can I install Python v3?

Fri Jun 15, 2012 4:40 pm

In Geany, go to Build -> Set Build Commands

The "Execute" command should read

Code: Select all

python "%f"
and this needs changing to

Code: Select all

python3 "%f"
.
EDIT: Sorry, that should be

Code: Select all

python3.1 "%f"
.

Return to “Python”