ggia
Posts: 2
Joined: Thu Jul 04, 2013 7:24 am
Location: Greece
Contact: Website

how to upgrade to latest Python 3.3.2

Thu Jul 04, 2013 7:36 am

Hello to all,

How can I upgrade to the new version (Python 3.3.2 - 15 May 2013) - . I am running Raspbian “wheezy” (2013-05-25-wheezy-raspbian).

Code: Select all

pi@raspberrypi ~ $ sudo apt-get upgrade python3
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi ~ $ python3
Python 3.2.3 (default, Mar  1 2013, 11:53:50)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
I want to use Raspberry Pi for the coursera class: Coding the Matrix: Linear Algebra through Computer Science Applications, and the course needs version 3.3.2.

Thanks in advanced,

ggia

ACP_
Posts: 33
Joined: Sat Aug 18, 2012 10:40 pm

Re: how to upgrade to latest Python 3.3.2

Thu Jul 04, 2013 8:03 am

Haven't actually done it with 3.x on the Rpi but I guess you can easily compile it from the sources if there is no binary package available yet. Here is the link to official instructions:
http://docs.python.org/devguide/

or you can try to find binary package from other source than raspbian but I'd go with compiling myself from the source option.

User avatar
rpdom
Posts: 15452
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: how to upgrade to latest Python 3.3.2

Thu Jul 04, 2013 8:17 am

ACP_ wrote:or you can try to find binary package from other source than raspbian but I'd go with compiling myself from the source option.
I'd agree that currently build from source is your best bet. Debian has 3.3.0 in it's experimental repository, but the Debian binaries are not Pi compatible. If you do find a binary/package file anywhere else, make sure it is specifically for the Raspberry Pi.

If you are keen, or have some experience building .deb files from Debian source packages, you could download the Debian source from experimental and try to build it (and any dependencies) on a Pi.

ggia
Posts: 2
Joined: Thu Jul 04, 2013 7:24 am
Location: Greece
Contact: Website

Re: how to upgrade to latest Python 3.3.2

Thu Jul 04, 2013 11:19 am

Thanks for all the replies..

I executed the following commands to compile/upgrade to Python 3.3.2 (from here).

Code: Select all

cd ~
wget http://www.python.org/ftp/python/3.3.2/Python-3.3.2.tar.bz2
tar jxf ./Python-3.3.2.tar.bz2
cd ./Python-3.3.2
./configure --prefix=/opt/python3.3.2
make && sudo make install
In case that the repositories will be updated and there will be the binaries of Python 3.3.2 what happens with this installation? I suppose I have to remove it manually? Just deleting by a"sudo rm -r /opt/python3.3.2"?

Can I remove the ~pi/Python-3.3.2 directory where the Python-3.3.2.tar.bz2 was unzipped? I suppose that I can do it because everything has been compiled and moved to /opt/python3.3.2 right?

I also made the link:

Code: Select all

mkdir ~/bin
ln -s /opt/python3.3.2/bin/python3.3 ~/bin/py 
And since ~/bin is at the path (.profile) I can call the python (after rebooting in order the system to update the path ~/bin) by the command:

Code: Select all

pi@raspberrypi ~ $ py
Python 3.3.2 (default, Jul  4 2013, 10:27:11)
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
Best regards,

ggia

shanlasani
Posts: 12
Joined: Wed Dec 11, 2013 12:46 am

Re: how to upgrade to latest Python 3.3.2

Sun Jan 05, 2014 3:32 am

Hi ggia,
I have followed your steps up till

Code: Select all

ln -s /opt/python3.3.2/bin/python3.3 ~/bin/py
.... but after restarting raspberry pi, when i do

Code: Select all

pi@raspberrypi ~ $ py
.... i get error

Code: Select all

bash: py: command not found
.... Can u tell me how to open Python idle 3.3.2 as i have compiled it, but don't know what's the missing link....

Regards,
Shan

relaytheurgency
Posts: 2
Joined: Wed May 15, 2013 10:13 pm

Re: how to upgrade to latest Python 3.3.2

Thu Apr 10, 2014 7:34 pm

That step creates a symbolic link (like a shortcut) called py that links to the python3.3 executable. Without that step you need to reference the python3.3 executable by its name.

Return to “Python”