How to Install Python and Set Up Your First Project (Beginner Guide)
Learn how to install Python on Windows, macOS, or Linux, set up VS Code, and create your first Python program in this beginner-friendly step-by-step guide.
Are you ready to start your Python journey? Great choice.
Python is one of the most beginner-friendly and versatile programming languages out there. But before you can write your first line of code, you need to set up your development environment properly.
In this guide, I’ll walk you through how to install Python, set up Visual Studio Code (VS Code), and create your first Python project - step by step.
Let’s get started.
Step 1: Download and Install Python
To run Python code, you need to install the Python interpreter on your system.
Download Python
- Visit the official Python website:
👉 https://www.python.org/downloads - It will automatically suggest the right download for your operating system.
- Click the yellow Download Python 3.x.x button.
At the time of writing, the latest stable version is Python 3.13.5, but the steps are the same for any 3.x version.
Installing Python on Windows
- Open the downloaded
.exe
file. - Check ✅ Add Python to PATH before installing.
- Click Install Now and wait for it to finish.
Confirm installation by opening Command Prompt and typing:
python --version
You should see:
Python 3.13.5
Installing Python on macOS
- Run the
.pkg
installer you downloaded. - Follow the installation instructions.
Open Terminal and type:
python3 --version
You should see:
Python 3.13.5
Installing Python on Linux
If Python is not installed or outdated, use:
sudo apt update
sudo apt install python3
Check your current version with:
python3 --version
On some distributions, the latest version might not be available by default. You can build from source or add a custom PPA (like deadsnakes for Ubuntu).
Step 2: Set Up Visual Studio Code (VS Code)
VS Code is a free, lightweight code editor perfect for writing Python.
Install VS Code
- Download it from https://code.visualstudio.com
- Install it for your operating system.
Install the Python Extension
- Open VS Code.
- Click on the Extensions tab (📦 icon in the sidebar).
- Search for Python and install the extension by Microsoft.
This gives you helpful features like auto-completion, syntax highlighting, and integrated terminal support.
Step 3: Create Your First Python Project
Create a Folder
Start by creating a new folder on your computer to organize your code:
python-projects/hello-python
Create a Python File
- Open the folder in VS Code.
- Create a new file named
main.py
.
Write Your First Python Code
In main.py
, type:
print('Hello, Python!')
Run the Python Script
Open the terminal in VS Code:
- Press
Ctrl + ~
(tilde) or clickTerminal > New Terminal
Then run your file:
python main.py
Or on macOS/Linux:
python3 main.py
You should see this output:
Hello, Python!
That’s your first Python program, successfully written and executed!
Quick Setup Checklist
Task | Completed? |
---|---|
Python installed and verified | ✅ |
Python added to PATH (Windows only) | ✅ |
VS Code installed | ✅ |
Python extension in VS Code | ✅ |
First Python file created and run | ✅ |
What’s Next?
Now that your development environment is ready, you’re all set to explore the Python language itself. Here are some great next steps:
- Learn about variables and data types
- Understand if-else conditions and loops
- Write your first Python functions
- Try a small beginner project (like a calculator or to-do app)
Have Questions?
If you ran into any issues during setup or have questions about what’s next, contact me here - I’m happy to help.
Happy coding!