Skip to main content
Every new Python project deserves the same solid foundation: a proper virtual environment, dependencies locked in pyproject.toml, secrets safely stored in a .env file, and the whole thing backed up on GitHub. Doing this consistently from the start takes less than ten minutes and saves hours of debugging and recovery work later. Run through these steps for every project — including the small ones — until it becomes second nature.

Step 1: Open your terminal

Step 2: Navigate to your projects folder

Create a single dedicated folder (like Projects/ or repos/) for all your Python work. It keeps things organized and makes it easy to find any project later.

Step 3: Create the project with uv

uv init generates a complete starting structure:
The .venv folder and uv.lock are created automatically when you first run uv add. You don’t need to do anything extra.

Step 4: Open in VS Code

VS Code opens with your project, the Python extension activates, and the virtual environment is detected automatically.
If code . doesn’t work, see the Git section for instructions on enabling the code shell command.

Step 5: Add your dependencies

Open the integrated terminal in VS Code (Ctrl + `):
Each uv add call updates pyproject.toml and uv.lock automatically.

Step 6: Test that everything works

Edit main.py to verify your setup:
All three lines should print without errors.

Step 7: Set up environment variables

Create .env for your actual secrets (this file stays on your machine only):
Create .env.example to document what variables are needed (this file is safe to commit):
.env is already listed in the .gitignore that uv init created. Confirm it’s there before your first commit.

Step 8: Initialize Git

Your first snapshot is saved. All files listed in .gitignore (including .venv and .env) are excluded automatically.

Step 9: Create and push to GitHub

Your project is now set up locally, tracked by Git, and backed up on GitHub.

The daily workflow

From this point on, your everyday routine is:
Prefer clicking to typing? VS Code’s Source Control panel (Ctrl/Cmd + Shift + G) lets you stage, commit, and push entirely with mouse clicks. The sync button in the status bar handles push and pull together.

Quick reference cheat sheet

Project creation (one time):
Daily development:

What’s next?

You’ve completed the Python tooling and project setup track. Continue with the weather data analysis project to put everything into practice.

Weather data analysis project

Build a real-world data analysis project using APIs and visualization