Greetings!
Interesting thing I discovered:
While trying to mess with some python I've written, I noticed that python scripts work wonderfully in the IDE, but fail miserably when run from a terminal window.
Further examination disclosed that the version of python used with the IDE, (Thonny), is 3.7.3, but the version used by the terminal is 2.7.16.
Huh?!! Silly me, I would have thought that both the IDE and the terminal would automagically use the same version, but apparently this is not true.
1. Why is this so?
2. Obviously python 3.7.3 is installed on this latest (?) version of Raspbian, how do I make it global?
Thanks!
-
- Posts: 165
- Joined: Sat Oct 05, 2013 10:26 pm
Raspbian python is 3.7.3 from the IDE but 2.7.16 from a terminal
Jim "JR"
Some see things as they are, and ask "Why?"
I dream things that never were, and ask "Why Not".
Robert F. Kennedy
“Impossible” is only found in the dictionary of a fool.
Old Chinese Proverb
Some see things as they are, and ask "Why?"
I dream things that never were, and ask "Why Not".
Robert F. Kennedy
“Impossible” is only found in the dictionary of a fool.
Old Chinese Proverb
- DougieLawson
- Posts: 40835
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
- Contact: Website Twitter
Re: Raspbian python is 3.7.3 from the IDE but 2.7.16 from a terminal
There's two versions of python. Python2 and python3. The default (with an alias of python) is python2. You can't change that or you'll break things.
If you want python3 from a command line use a python3 command.
This mess gets fixed in 2020 when python2.7 goes end-of-life (although it won't be fixed in DebIan/Raspbian until Bullseye emerges as the "stable" version in 2021).
https://pythonclock.org/
If you want python3 from a command line use a python3 command.
This mess gets fixed in 2020 when python2.7 goes end-of-life (although it won't be fixed in DebIan/Raspbian until Bullseye emerges as the "stable" version in 2021).
https://pythonclock.org/
Any language using left-hand whitespace for syntax is ridiculous
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
-
- Posts: 165
- Joined: Sat Oct 05, 2013 10:26 pm
Re: Raspbian python is 3.7.3 from the IDE but 2.7.16 from a terminal
Sheesh!
I can't imagine why this is so, (version 2 is the current functional version of Python on Debian and the Pi), and it won't get updated until 2021?
* Every book on the subject written anytime in the last few years assumes a 3.n version of Python.
* The current version of Python is 3.8.something. (at least as far as what I read on the Internet is concerned.)
* (IMHO), by the time we get to version 3.something, the current version will be 4!!
No, I'm not the distribution maintainer, (spinning distro's is something else I'd like to learn), but I cannot imagine why we're such laggards.
You have my curiosity riz, as they say. . . .
P.S. I'm waiting for the ISO standard version of Python - right now it's too much of a moving target to program anything serious on - I'd be afraid that every time I sneeze, something would change that would break my code.
I can't imagine why this is so, (version 2 is the current functional version of Python on Debian and the Pi), and it won't get updated until 2021?
* Every book on the subject written anytime in the last few years assumes a 3.n version of Python.
* The current version of Python is 3.8.something. (at least as far as what I read on the Internet is concerned.)
* (IMHO), by the time we get to version 3.something, the current version will be 4!!
No, I'm not the distribution maintainer, (spinning distro's is something else I'd like to learn), but I cannot imagine why we're such laggards.
You have my curiosity riz, as they say. . . .
P.S. I'm waiting for the ISO standard version of Python - right now it's too much of a moving target to program anything serious on - I'd be afraid that every time I sneeze, something would change that would break my code.
Jim "JR"
Some see things as they are, and ask "Why?"
I dream things that never were, and ask "Why Not".
Robert F. Kennedy
“Impossible” is only found in the dictionary of a fool.
Old Chinese Proverb
Some see things as they are, and ask "Why?"
I dream things that never were, and ask "Why Not".
Robert F. Kennedy
“Impossible” is only found in the dictionary of a fool.
Old Chinese Proverb
- DougieLawson
- Posts: 40835
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
- Contact: Website Twitter
Re: Raspbian python is 3.7.3 from the IDE but 2.7.16 from a terminal
You're right it's a steaming pile of [insert well known emoji here]. It's been a mess since 2012. It's yet another thing that's wrong with python. Ubuntu has fixed it already.
Any language using left-hand whitespace for syntax is ridiculous
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Re: Raspbian python is 3.7.3 from the IDE but 2.7.16 from a terminal
Python 3.7.3 is already installed by default with Raspbian Buster.jharris1993 wrote: ↑Thu Oct 17, 2019 6:32 pm(version 2 is the current functional version of Python on Debian and the Pi), and it won't get updated until 2021?
(IMHO), by the time we get to version 3.something, the current version will be 4!!
You just have to remember to invoke it using "python3" on the command line because using just "python" invokes python 2 .7.16 and has to be as such so as to not have Raspbian break unexpectedly.
Apart from the change from 2 to 3, required because changes did break existing code, Python has generally not broken existing code as new versions have arrived.jharris1993 wrote: ↑Thu Oct 17, 2019 6:32 pmP.S. I'm waiting for the ISO standard version of Python - right now it's too much of a moving target to program anything serious on - I'd be afraid that every time I sneeze, something would change that would break my code.