By Ivan Santos - Wed Mar 09 2022

Install Python as Java Developer

Hello people,

I have started on my journey to learn Python. But before the journey begins, I need the right tools to fulfill the mission. And for me, the tool is to have Python installed to write any piece of code in this new language!

FYI, I am currently using my wife’s Macbook Air to do programming. It is running the latest macOS at the time this post was written.

Alright. Let’s get started.

First, I will check that Python is not pre-installed. My tip to you is always to make sure that what you are looking for is not already installed.

Python 2.7 seems to come pre-installed with the operating system. However, the very first line is concerning. It says Python 2.7 is not recommended. I tend to listen to the tool’s creator of tools when they specifically tell me something is not recommended. And besides, Python 2.7 is relatively old as well; it was released back in 2010 (release notes). But wait a second… The warning also mentions using ‘python3’. Let’s give it a try.

It seems that both Python 2 and 3 come pre-installed on Mac OS! It couldn’t have been easier!

Now that I have it installed, I would like to run some code. I found this official guide for a hello world program. Let’s give it a try.

I created a file main.py

print("Hello World, Youtube.")

And let’s run it!

Easy peasy. I created my first Hello World, program.

Alright, so that is how a Java developer would install Python on macOS Monterey: by just using the pre-installed version of Python :)

Alright, people. I’ll see you at the next one!