| title | Setting up a Python Environment |
|---|---|
| layout | framework_docs |
| objective | How to setup a functional python environment on your local machine. |
| order | 0 |
Make sure that Python is already installed on your computer along with a way to create virtual environments.
This allows you to run your project locally, and test that it works, before deploying it to Fly.io.
For project and dependency management we use uv. Like most package managers, uv combines multiple tools in one.
You have other options:
If you are just starting out, it is easiest to follow along using uv.
This will make your development environment resemble what ends up happening inside the docker image.
You can create a new project using this command:
uv init <app-name>Once inside the project, you can add packages with the add command:
uv add <dep>This will automatically create a virtual environment for you.
To interact with your virtual environment, you can prefix your commands with uv run:
uv run python main.py