How to Install Python and Create Your First Script


You want to get started developing something in Python? Maybe a to-do list… or possibly even something for data science or a web server? That would be awesome… if they Python code would run 😉. We can’t put the horse before the buggy, and we can’t put the project ahead of the Python installation! Let’s get started on getting Python installed on your local system.


🗺️ Where Can We Find the Installer?

Python can be downloaded from the Python.org Downloads page. If you have issues with that link, what you will want to do is head over to Python.org and click on the Downloads tab in the navigation bar.

Here you can download different versions of Python. Unless you are looking for something specific, the best option is to grab the latest stable release so you can make use of Python’s latest and greatest features. Once you download the installer for your system (Windows, Mac, or Linux), go ahead and run the installer.


❗ Add to Path (Windows & Mac)

When the installer is running (this is mainly for Windows & Mac) ensure that Add to Path is checked so it automatically sets up the proper environment variables.

These environment variables allow you to use Python in the command line. This is great when you need to handle things easily like creating virtual environments and other Python tasks without going through extra steps.


🐧 Linux Users

On newer Debian Linux versions, it is extremely easy to add python to your system through the terminal. This includes Ubuntu! Just follow the prompts below:

sudo apt get-update
sudo apt install python3

Keep in mind, this installs the latest version (Python 3.x) as of this writing. In the future on the next major release, you will have to update this to the right version. For example: python4 instead of python3.


🔍 Checking Your Install

The best way to check your install is to close all of your terminal / command prompt instances and open a new one. Then you can run the version command to verify that it installed correctly:

On Windows

python --version

On Linux/Mac

python3 --version

You should see your version appear, in my case it is the following:

Python 3.13.5

Boom💥! Once you see that, Python is successfully installed.


📃 Your First Script

Open your favorite code editor (mine is Visual Studio Code) and create a new Python file named “HelloWorld.py”. Inside, put the following code:

print("Hello, world!")

Now, navigate to the directory where your Python file resides and enter the following command:

Windows:

python HelloWorld.py

Mac/Linux:

python3 HelloWorld.py

You should see your “Hello, World!” application come to life with the following:

Hello, World!

Once you see that, you are ready to build your dream programs in Python! Next, you should learn all of the building blocks that make Python awesome. Once you understand how Python works, you should learn how to create virtual environments so you can use different dependencies that won’t class with the different projects you end up building!

Good luck on your development journey, and I hope you enjoy it!