Learning and writing Python codes under Mac OS?

hajime

macrumors 603
Original poster
Jul 23, 2007
5,879
812
Hi, has anybody tried this before? Is it as simple as doing it under Linux or Windows 10?
 

revmacian

macrumors 68000
Oct 20, 2018
1,658
1,350
USA
Easier. Launch terminal > prompt > python.
Wouldn't that launch the python 2.7.x version that ships with macOS? That version is old and will likely be replaced with python 3.8.x in macOS versions after Catalina.
 

Analog Kid

macrumors 601
Mar 4, 2003
4,890
2,972
If you’re learning Python, look at Anaconda and the Jupyter platform.


Im pretty sure Jupyter comes as part of the default conda distribution, but it’s easy enough to install separately if you need to.
 
  • Like
Reactions: revmacian

revmacian

macrumors 68000
Oct 20, 2018
1,658
1,350
USA
If you’re learning Python, look at Anaconda and the Jupyter platform.


Im pretty sure Jupyter comes as part of the default conda distribution, but it’s easy enough to install separately if you need to.
And, if you're just learning Python, I recommend going with the Python 3.8.x distribution because it will be easier to start with Python 3 than learning the syntax changes from Python 2 to Python 3. If I'm reading the signs correctly, macOS versions after Catalina will ship with Python 3.8.
 
Last edited:

Analog Kid

macrumors 601
Mar 4, 2003
4,890
2,972
And, if you're just learning Python, I recommend going with the Python 3.8.x distribution because it will be easier to start with Python 3 than learning the syntax changes from Python 2 to Python 3. If I'm reading the signs correctly, macOS versions after Catalina will ship with Python 3.8.
Anaconda currently offers 3.7, which I think is probably fine. I’m sure you can update it to 3.8 manually, but the differences are probably minimal to a new learner...
 

revmacian

macrumors 68000
Oct 20, 2018
1,658
1,350
USA
From the Catalina release notes, future versions of macOS won’t include scripting language runtimes by default, so unless they happen to be using one for some reason, you will need to install it yourself.
Ah, that is good to know, thank you very much. So, we may need to install Python 3 manually in macOS 10.16. From what I've seen with the Python website over the years.. this shouldn't be difficult at all.
 

KALLT

macrumors 601
Sep 23, 2008
4,990
3,048
Python 3 is bundled with Xcode Command Line Tools (xcode-select --install) or bundled with Xcode. You can also install any scripting languages with package managers like Homebrew and MacPorts.
 
  • Like
Reactions: revmacian

revmacian

macrumors 68000
Oct 20, 2018
1,658
1,350
USA
Python 3 is bundled with Xcode Command Line Tools (xcode-select --install) or bundled with Xcode. You can also install any scripting languages with package managers like Homebrew and MacPorts.
That makes sense. On Catalina you can run the command python3 and it will launch xcode-select. I wonder why Apple included both of these executables instead of symlinking one to the other. There is no man page for python3, so I'm kinda confused.