You want to set up a Python development environment and start coding. But before you’ve written your first script, you’ve come across discussions about editors, shells, virtual environments, and half a dozen tools for installing packages. How much of this do you need to get started?
An effective setup gives you a place to write code, a Python interpreter to run it, and a way to keep each project’s packages separate. For a new project, VS Code and uv are a practical starting point. You can use the terminal that comes with your operating system and add other tools as you discover what helps you work.
In this guide, you’ll find resources to help you:
- Choose an editor and connect it to Python
- Use your terminal to run commands
- Manage Python and project dependencies with uv
- Explore code interactively and get feedback on your work
Each section gives you enough context to make a choice, then points you toward tutorials and video courses where you can practice. You don’t need to install everything mentioned here. If you already have a setup that works for you, then use this guide to fill in the parts that still feel unfamiliar.
Free Bonus: Click here to get access to a free 5-day class that shows you how to avoid common dependency management issues with tools like Pip, PyPI, Virtualenv, and requirements files.
Choose Your Python Development Environment
Your development environment should help you work on the project in front of you. A few tools are enough to start, and you can keep using them as your projects grow.
For a new Python project on your own computer, you can start with these choices:
| Part of Your Setup | Starting Choice | What It Helps You Do |
|---|---|---|
| Code editor | VS Code with its Python extension | Write, run, and debug Python code |
| Terminal and shell | Your operating system’s existing tools | Navigate folders and run commands |
| Python and packages | uv | Manage Python versions and each project’s dependencies |
| Project folder | One folder per project | Keep your code and configuration together |
These tools work together. You open a project folder in your editor, use uv to manage its Python environment, and run your code with that environment’s interpreter. You’ll learn what each part does in the sections below.
If you’re following a tutorial or joining an existing project, then start with its setup instructions. A project that uses Poetry or venv doesn’t need a different package manager before you can contribute. Matching the project’s workflow gives you fewer differences to troubleshoot while you’re learning.
Choose an Editor and Connect It to Python
Your code editor is where you’ll spend much of your time reading and writing Python. Syntax highlighting helps you recognize the parts of your code, and a debugger lets you pause a program to inspect what’s happening.
An editor window can be as uncluttered as this example in VS Code:
The colors and indentation make the code’s structure easier to see. You don’t need to understand this example’s code to start with a similarly simple workspace.
Visual Studio Code, or VS Code, is a useful starting choice for scripts and projects. Install Microsoft’s Python extension, open your project folder, and select the Python interpreter that belongs to that project. For a uv-managed project, that’s typically the interpreter inside its .venv folder, once uv has created the environment.
If your editor runs a different Python installation from the one where you installed your packages, then an import can fail even though the installation succeeded. The virtual environments primer shows you how to select an environment in VS Code.
You might prefer PyCharm, an integrated development environment that brings Python editing, debugging, and project tools together. PyCharm for Productive Python Development walks you through working with it. If you’re at the very beginning and want a smaller interface to explore, then take a look at Thonny.
Pick one editor and learn how to open a folder, save a Python file, and run it. You can leave themes, extra extensions, and elaborate keyboard shortcuts for later.
Get Comfortable With Your Terminal
A terminal is the application where you type commands and read their output. A shell is the program inside it that interprets those commands. Windows Terminal can run PowerShell, for example, while the Terminal app on macOS normally starts Zsh.
When you open a terminal, you might see little more than a prompt waiting for your input:
The cursor marks where your command will appear as you type. Your prompt may look different, but you don’t need to customize it before you can use it.
You don’t need to change either one to start coding. PowerShell on Windows, Zsh on macOS, and Bash on many Linux systems all let you navigate to a project folder and run Python tools. Your editor may also have an integrated terminal, which keeps that command-line session close to your code.
Start by learning how to find your current folder, list its contents, and move into another folder. The Terminal: First Steps and Useful Commands for Python Developers introduces these skills with instructions for each operating system.
If you prefer to follow along with a video, then choose the course for your system:
As you follow tutorials, pay attention to which shell a command targets. A command written for Bash won’t always work unchanged in PowerShell. You can learn the commands for your own system without installing a second operating system first.
Manage Python and Packages With uv
Python runs your code, and third-party packages add functionality that you can use in your projects. For example, a web scraper might use Requests to download pages, while a data analysis project might use pandas to work with tables.
Those projects should have separate virtual environments. Each environment uses a particular Python interpreter and has its own installed packages. This lets you update a package for one project without changing the version that another project relies on.
The uv project manager handles much of this setup for you. It can install Python, create a project’s virtual environment, and record its dependencies. You can install uv with its standalone installer even if you haven’t installed Python yet.
In a uv project, you’ll encounter a few commands repeatedly. You start a project with uv init, add a dependency with uv add, and run code in the project’s environment with uv run. When needed, uv creates a .venv folder and installs the project’s dependencies there. You don’t need to activate that environment manually when you use uv run.
The project also has files that help you keep track of its setup:
pyproject.tomlrecords project information, supported Python versions, and declared dependencies..python-versiontells uv which Python version to use for the project.uv.lockrecords resolved dependency versions so uv can re-create the package setup.
Keep these files with your code in version control. The .venv folder itself stays out of version control because you can rebuild it. A lockfile helps reproduce your Python dependencies, but it doesn’t capture your entire computer, such as operating system libraries or external services.
For a guided setup, start with Managing Python Projects With uv or watch Python Project Management With uv. Both take you through creating a project and managing its dependencies. You can stop before packaging and publishing if your goal is to run code locally.
Choose a stable Python version supported by the tutorial or project you’re working on. You can add another version later when you need it, without replacing a Python installation that your operating system manages.
Understand Where Other Package Tools Fit
You may already have Python installed and have followed tutorials that use venv and pip. That’s still a useful workflow. Python’s venv module creates the virtual environment, and python -m pip runs pip with the Python interpreter you’ve selected.
Python Virtual Environments: A Primer explains this workflow, including activation and common setup problems. Once you understand the underlying idea, tools that manage environments for you become less mysterious.
If you want to compare the approaches, then read uv vs pip: Managing Python Packages and Dependencies or watch the uv vs pip video course. In a uv-managed project, use uv add for project dependencies. Installing a package with uv pip install alone doesn’t record it in pyproject.toml and uv.lock.
You’ll also encounter Poetry in existing projects and pyenv for managing Python versions. Scientific projects may use conda, which can manage Python packages and non-Python dependencies together. If a project provides a conda environment, then follow its instructions. The primer’s conda overview explains where it fits.
There’s one more distinction worth knowing: a package that your code imports belongs in your project’s environment, while a standalone command-line application can have an environment of its own. For those applications, uv provides uv tool install and uvx. pipx offers another way to install and run Python applications in separate environments.
You don’t need both tool installers. If you’ve chosen uv, then its tool commands cover this use case too. Keep tools that need to import your project, such as your test runner, with the project’s development dependencies.
Try Out Ideas in a REPL or Notebook
Sometimes you want to check what one expression does before adding it to a script. A read-eval-print loop, or REPL, lets you enter Python code and see the result immediately.
Python comes with a REPL. In a uv project, you can start it with uv run python, which also makes the project’s installed packages available. The Python Standard REPL shows you how to use it to explore code and ideas.
If you’re analyzing data, then a notebook can be a comfortable place to work. You can keep code, written explanations, and plots together, and run small sections of code as you investigate a question.
Start with Jupyter Notebook: An Introduction or the Using Jupyter Notebooks video course. When you’re comfortable with notebooks, JupyterLab gives you a workspace for notebooks, files, and terminals.
A notebook runs Python through a kernel, the process that executes its code. Just as with your editor, make sure the notebook uses an environment containing the packages you need. A package installed in a different environment won’t automatically become available in your notebook.
Add Tools That Give You Useful Feedback
Once you can write and run code, you can add tools that help you spot mistakes and understand changes. Start with a problem you’ve actually encountered. If you’re spending time fixing whitespace, for example, then a formatter can do that work for you.
Ruff combines a linter, which checks for potential errors and style issues, with a formatter that makes your code’s layout consistent. The Ruff tutorial and Modern Python Linting With Ruff show you how to use both. Your editor can run these checks and format your code when you save a file.
You can also keep Ruff’s feedback beside your code by running it in watch mode in an integrated terminal:
In this example, Ruff reports no lint errors and waits for file changes. That doesn’t guarantee that the program behaves correctly, but it gives you one useful check while you work.
Git records changes to your project so you can compare versions and return to an earlier state. You can use it locally before sharing anything online. How to Use Git: A Beginner’s Guide walks you through tracking files and recording changes.
Your project’s history can look like this example, which lists changes recorded with Git:
The messages describe small steps, such as updating a greeting or renaming a file. Recording changes this way gives you a history to consult when you want to understand how your project got to its current state.
When you’re ready to share a project or work with others, GitHub gives your Git repository a home online. How to Use GitHub shows you how to create a remote repository, upload your local project, and collaborate with other developers.
As your programs grow, Python Code Quality: Best Practices and Tools introduces testing and type checking. These tools answer different questions about your code, so you can add them as you learn what feedback you need.
AI coding assistants are worth exploring as you build your setup. You can use one to explain unfamiliar code, suggest changes, or help investigate an error, while you stay responsible for understanding and testing the result. To choose an assistant and learn how to work with it, take a look at the Python Coding With AI learning path:
Learning Path
Python Coding With AI
12 Resources ⋅ Skills: Cursor, Claude Code, AI-Assisted Development
Start with one tool and try it on a small project you can understand and check.
Choose Your Next Step
You now have a map of the main parts of a Python development environment. An editor gives you a place to write, a terminal lets you run commands, and a project environment keeps your Python packages together.
If you’re starting a new project, then open the uv project tutorial and work through creating an environment and running your code. If you already have Python and want to understand virtual environments first, then start with the virtual environments primer. The Python installation guide is there if you need help installing Python directly.
Pick the resource that addresses your next question, and keep this page around for when another one comes up. Once you can run your code and explain where its packages live, you’ve got a place to work. You can make yourself at home as you go.