helpme
Posts: 124
Joined: Thu May 16, 2013 2:20 am

Is python 3 the default python version in Raspbian Stretch?

Fri Aug 25, 2017 5:59 am

I have been longing for this to happen. is python 3 now the default version in Stretch?

klricks
Posts: 7135
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Is python 3 the default python version in Raspbian Stretch?

Fri Aug 25, 2017 6:12 am

helpme wrote:
Fri Aug 25, 2017 5:59 am
I have been longing for this to happen. is python 3 now the default version in Stretch?
What do you mean by default?
Python 2.7.13 and and 3.5.3 are both installed.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

helpme
Posts: 124
Joined: Thu May 16, 2013 2:20 am

Re: Is python 3 the default python version in Raspbian Stretch?

Fri Aug 25, 2017 6:22 am

klricks wrote:
Fri Aug 25, 2017 6:12 am
helpme wrote:
Fri Aug 25, 2017 5:59 am
I have been longing for this to happen. is python 3 now the default version in Stretch?
What do you mean by default?
Python 2.7.13 and and 3.5.3 are both installed.
Default means when I type "python" at command line, v3 is used and not v2.

jahboater
Posts: 5680
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Is python 3 the default python version in Raspbian Stretch?

Fri Aug 25, 2017 7:58 am

helpme wrote:
Fri Aug 25, 2017 6:22 am
Default means when I type "python" at command line, v3 is used and not v2.
No.

Code: Select all

pi@Pi3:~ $ python
Python 2.7.13 (default, Jan 19 2017, 14:48:08) 
[GCC 6.3.0 20170124] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
pi@Pi3:~ $ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04) 
[GCC 6.3.0 20170124] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
pi@Pi3:~ $ 
but a quick fix might be (in your ~/.bashrc):-

Code: Select all

pi@Pi3:~ $ alias python=python3
pi@Pi3:~ $ python
Python 3.5.3 (default, Jan 19 2017, 14:11:04) 
[GCC 6.3.0 20170124] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
pi@Pi3:~ $ 

Return to “Raspberry Pi OS”