If you’ve recently installed Python on your Windows 11 PC and are wondering how to start your first real project — you’re in the right place. Setting up your first Python project can seem intimidating at first, but it’s actually pretty straightforward once you understand the basics. In this guide, we’ll walk you through everything — from creating your project folder to running your first Python script like a pro.
What You’ll Need Before Starting
Before we begin, make sure you have:
- Python installed (preferably the latest version).
- Pip properly configured in your PATH.
- A code editor like Visual Studio Code (VS Code), PyCharm, or even Notepad++ (though VS Code is highly recommended).
If you haven’t installed Python yet, check out our guide on How to Install the Latest Python Version on Windows 11.
Step 1: Create a Project Folder
Let’s start by setting up a dedicated folder for your project.
- Open File Explorer and navigate to a convenient location (like
DocumentsorDesktop). - Create a new folder — for example:
MyFirstPythonProject - Inside this folder, create a new file named
main.py.
This will be your main Python script — think of it as your program’s starting point.
Step 2: Open the Folder in VS Code
If you’re using Visual Studio Code (which we strongly recommend):
- Open VS Code.
- Click on File → Open Folder.
- Select your
MyFirstPythonProjectfolder. - Once it’s open, create a new file called
main.pyif you haven’t already. - You should now see your project structure in the Explorer sidebar.
Step 3: Set Up a Virtual Environment
A virtual environment keeps your project’s dependencies isolated — so you don’t accidentally mess up global packages.
- Open the terminal in VS Code (
Ctrl + ``). - Run the following command:
python -m venv venv - This will create a new folder called
venvinside your project directory. - Activate it by running:
venv\Scripts\activateOnce activated, you’ll see(venv)appear before your command prompt — that means you’re working inside the virtual environment.
Step 4: Install Dependencies (Optional)
If your project requires any external libraries, install them with pip.
For example, let’s say you want to use the requests library:
pip install requests
You can check installed packages anytime by running:
pip list
Step 5: Write Your First Python Script
Now let’s write some basic code to make sure everything’s working fine.
Open your main.py file and add the following:
print("Hello, World! Welcome to your first Python project!")
Save the file, and then run it using the terminal:
python main.py
If you see the greeting message printed in the terminal — congratulations! You’ve successfully created and run your first Python project.
Step 6: Keep Your Project Organized
As your project grows, it’s a good idea to keep things tidy. Here’s a simple structure you can follow:
MyFirstPythonProject/
│
├── venv/
├── main.py
├── requirements.txt
└── data/
You can store additional scripts, configuration files, and data folders here as your project expands.
Bonus Tip: Save Dependencies
If you plan to share your project or move it to another machine, it’s helpful to save your dependencies:
pip freeze > requirements.txt
Later, anyone (including you) can install all the dependencies with:
pip install -r requirements.txt
Wrapping Up
Setting up your first Python project on Windows 11 is easier than it looks — and it’s an essential first step toward becoming a Python developer. You’ve now learned how to organize your code, use virtual environments, and run scripts efficiently. From here, you can start experimenting with small programs, APIs, or even web development frameworks like Flask or Django.