RPiTinker
Posts: 11
Joined: Mon Apr 09, 2018 3:13 am

Upgrade Python from 3.5.3 to latest version

Tue Jan 08, 2019 4:36 am

I am using the latest image: 2018-11-13-raspbian-stretch-lite.img. It still has python 3.5.3

Code: Select all

pi@raspberrypi:~ $ python3 --version
Python 3.5.3
I am attempting to use Amazon Alexa Skills, which require python 3.6+

Are there new instructions on how to upgrade python? My own attempts have failed

Code: Select all

/usr/bin/python3: bad interpreter: No such file or directory
These old steps are confusing
viewtopic.php?p=1402804

User avatar
DougieLawson
Posts: 39139
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Upgrade Python from 3.5.3 to latest version

Tue Jan 08, 2019 7:27 pm

What part of python 3.6 does Alexa depend on? Have you tried it with python 3.5 on Raspbian Stretch? Are you able to wait for Raspbian Buster which has frozen with python3 3.7.1-3.

Have you looked at installing the Buster package on your Stretch system? From http://mirrordirector.raspbian.org/rasp ... python3.7/
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
croston
Posts: 707
Joined: Sat Nov 26, 2011 12:33 pm
Location: Blackpool
Contact: Website

Re: Upgrade Python from 3.5.3 to latest version

Tue Jan 08, 2019 8:13 pm

You could build it from source. I have blogged about it here:
https://www.wyre-it.co.uk/blog/latestpython/

RPiTinker
Posts: 11
Joined: Mon Apr 09, 2018 3:13 am

Re: Upgrade Python from 3.5.3 to latest version

Wed Jan 09, 2019 2:12 pm

DougieLawson wrote:
Tue Jan 08, 2019 7:27 pm
What part of python 3.6 does Alexa depend on? Have you tried it with python 3.5 on Raspbian Stretch? Are you able to wait for Raspbian Buster which has frozen with python3 3.7.1-3.

Have you looked at installing the Buster package on your Stretch system? From http://mirrordirector.raspbian.org/rasp ... python3.7/
I don't know what part Alexa Scripts depend on; I only attempted to meet the written prerequisites.
I will attempt python3.5 as 3.7 is a non-starter for me. I'll get 3.7 to function.
When (rough estimate) would Raspbian Buster be available? (I can wait weeks, but not months)

I don't know what to do with the folder for the package.
Last edited by RPiTinker on Thu Jan 10, 2019 5:00 am, edited 2 times in total.

RPiTinker
Posts: 11
Joined: Mon Apr 09, 2018 3:13 am

Re: Upgrade Python from 3.5.3 to latest version

Wed Jan 09, 2019 2:17 pm

croston wrote:
Tue Jan 08, 2019 8:13 pm
You could build it from source. I have blogged about it here:
https://www.wyre-it.co.uk/blog/latestpython/
Your process had fewer dependencies then I had used (older instructions: https://medium.com/@manivannan_data/ins ... d9b4f11e5c).
And you added "--enable-shared" to the ./configure .

(BTW thanks for explaining why in your change log!)

Still not successful - different error. Details on your page.
Last edited by RPiTinker on Thu Jan 10, 2019 4:55 am, edited 1 time in total.

User avatar
croston
Posts: 707
Joined: Sat Nov 26, 2011 12:33 pm
Location: Blackpool
Contact: Website

Re: Upgrade Python from 3.5.3 to latest version

Wed Jan 09, 2019 2:33 pm

Sorry - I forgot to add:

Code: Select all

sudo ldconfig
Run that on it's own at a shell prompt and it should work.

RPiTinker
Posts: 11
Joined: Mon Apr 09, 2018 3:13 am

Re: Upgrade Python from 3.5.3 to latest version

Thu Jan 10, 2019 4:01 am

croston wrote:
Wed Jan 09, 2019 2:33 pm
add:

Code: Select all

sudo ldconfig
Thank you! now the basics of python3.7.2 work and I can begin the evaluation I initially wanted


(again, details on your page)

Return to “Troubleshooting”