KittyHawk
Posts: 11
Joined: Wed Oct 10, 2012 11:24 am

Building Python 3.6.0 on RPi 3 from sources (clean Raspbian)

Wed Jan 25, 2017 4:44 pm

You can install Python 3.6 on your Raspberry Pi using this instructions:

http://bohdan-danishevsky.blogspot.com/ ... -pi-3.html

Hope it will be useful to you. Thank you.

User avatar
scruss
Posts: 1670
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Building Python 3.6.0 on RPi 3 from sources (clean Raspb

Wed Jan 25, 2017 5:20 pm

Code: Select all

sudo apt install python3 python3-pip python3-doc
gets you 3.4. Which is probably enough for most folks.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

KittyHawk
Posts: 11
Joined: Wed Oct 10, 2012 11:24 am

Re: Building Python 3.6.0 on RPi 3 from sources (clean Raspb

Wed Jan 25, 2017 5:24 pm

scruss wrote:

Code: Select all

sudo apt install python3 python3-pip python3-doc
gets you 3.4. Which is probably enough for most folks.
Yep, it can be useful for some guys. I had task when I needed Python >= 3.5.0 so I made post about how to install Python 3.5.0 and now updated it to 3.6.0. Hope it will be useful for some tasks

hippy
Posts: 3017
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Building Python 3.6.0 on RPi 3 from sources (clean Raspb

Wed Jan 25, 2017 8:21 pm

KittyHawk wrote:Hope it will be useful to you. Thank you.
It is useful; thanks. Your instructions worked flawlessly for me.

There has been past discussions on execution speed between Python 2 and 3 where 3 is notably slower in most cases. It was suggested there were improvements in 3.6, but as I could not figure out how to get 3.6 installed and running I could not check that out. With your instructions I can.

My simplistic integer test on a Pi 3B showed about the same increase in execution time for 3.4.2 and 3.6.0, both taking 73% longer to run than 2.7.9 -

Code: Select all

n = 0
for i in range(0,1000000):
  n = n + 1

Code: Select all

Python  2.7.9       3.4.2       3.6.0

real    0m0.726s    0m1.130s    0m1.257s
user    0m0.710s    0m1.120s    0m1.250s
sys     0m0.020s    0m0.000s    0m0.000s
My equally simplistic floating point test did however show some improvement for 3.6.0 over 3.4.2. Still, 3.6.0 takes 19% longer than 2.7.9, but better than 3.4.2 which takes 42% longer -

Code: Select all

f = 0.0
while f < 500000.0:
  f = f + 0.5  

Code: Select all

Python  2.7.9       3.4.2       3.6.0

real    0m0.875s    0m1.242s    0m1.038s
user    0m0.870s    0m1.230s    0m1.020s
sys     0m0.000s    0m0.010s    0m0.010s
I think I'll be sticking with Python 2 for the time being.

hippy
Posts: 3017
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Building Python 3.6.0 on RPi 3 from sources (clean Raspbian)

Sat Aug 26, 2017 10:57 am

Updated for the latest Python versions which come with Rasbian Stretch and MicroPython for comparison -

Simplistic Integer Benchmark

Code: Select all

n = 0
for i in range(0,1000000):
  n = n + 1

Code: Select all

Python  2.7.13      3.5.3       MicroPython 1.9.2

real    0m1.026s    0m1.425s    0m0.976s
user    0m0.960s    0m1.420s    0m0.930s
sys     0m0.050s    0m0.000s    0m0.010s
Simplistic Floating Point Benchmark

Code: Select all

f = 0.0
while f < 500000.0:
  f = f + 0.5  

Code: Select all

Python  2.7.13      3.5.3       MicroPython 1.9.2

real    0m1.375s    0m1.503s    0m1.249s
user    0m1.340s    0m1.490s    0m0.240s
sys     0m0.020s    0m0.000s    0m0.000s

caprojects
Posts: 2
Joined: Thu Oct 20, 2016 9:57 pm

Re: Building Python 3.6.0 on RPi 3 from sources (clean Raspbian)

Wed Sep 06, 2017 3:48 pm

I will be honest and say that I think that raspbian needs to have an update for the base install of python from 3.4.2 (current) to atleast 3.6.0, preferably 3.6.2

I would like to be able to write code for python 3.6 so that people can be able to use the program on any platform with out having to go though the process of building python 3.6 from source especially when they have never used Linux before etc. I have stopped developing on the rpi due to this which is sad really.

hippy
Posts: 3017
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Building Python 3.6.0 on RPi 3 from sources (clean Raspbian)

Wed Sep 06, 2017 7:15 pm

caprojects wrote:
Wed Sep 06, 2017 3:48 pm
I would like to be able to write code for python 3.6 so that people can be able to use the program on any platform with out having to go though the process of building python 3.6 from source
The usual approach is to target code for the lowest version one can, then most users can run that regardless of what version they have.

Unless the code uses some feature only available in a later version it shouldn't generally present problems. With a little bit of effort it is usually possible to write code which runs on both Python 2.7 and 3.x

User avatar
scruss
Posts: 1670
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Building Python 3.6.0 on RPi 3 from sources (clean Raspbian)

Wed Sep 06, 2017 8:09 pm

One has to wonder what Python 3.6 provides that caprojects so desperately needs.

The newest version I have on any machine in the house is 3.5.3, so to use 3.6, I'd have to build from source. This puts off a lot of users.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
fruitoftheloom
Posts: 16595
Joined: Tue Mar 25, 2014 12:40 pm
Location: Bognor Regis UK

Re: Building Python 3.6.0 on RPi 3 from sources (clean Raspbian)

Wed Sep 06, 2017 9:25 pm

caprojects wrote:
Wed Sep 06, 2017 3:48 pm
I will be honest and say that I think that raspbian needs to have an update for the base install of python from 3.4.2 (current) to atleast 3.6.0, preferably 3.6.2

I would like to be able to write code for python 3.6 so that people can be able to use the program on any platform with out having to go though the process of building python 3.6 from source especially when they have never used Linux before etc. I have stopped developing on the rpi due to this which is sad really.
Raspbian follows Debian Stretch ARMHF, for the RPF to offer a newer package would mean hours of testing for compatibility, time and money which could be better spent on the fulfilling of the Charitable Aims.

If you want latest and greatest a Rolling Release like Arch should suffice, which offers Python 3.6.2 already.

So basically problem solved without.........
""understanding the theoretical, but not always the end goal""

My other Devices are the ChromeBit CS10, ChromeCast & Huawei Mate 10 Pro SmartPhone

Return to “Python”

Who is online

Users browsing this forum: No registered users and 23 guests