• By Bernat Sampera • 1 min read
UV: how to create a project with a python package manager
UV is much faster and really easy to use, this is why it has gained a lot of adoption this last year. This intro explains briefly how to quickly set up a project with it
If you also find the whole requirements.txt kind of annoying, uv handle it much more similarly to npm. Here is how to create a project with it.
Step 1: Create the repo
uv init
This will create the following
.git - directory to handle repo
.gitignore - ignore files that shouldn’t be commited
.python-version - specifies the version of python being used
main.py - entry point of the app (You can change this)
pyproject.toml - Handles the dependencies and basic repo information(like package.json in npm)
Readme.md - …
Step 2: Create a virtual environment
uv venv # this creates a .venv directory where the dependencies will be stored
source .venv/bin/activate # To activate this virtual environment