Uv
Introduction
An extremely fast Python package and project manager, written in Rust.
A single tool to replace
pip,pip-tools,pipx,poetry,pyenv,twine,virtualenv, and more.
Install & manage python version
uv python install: Install Python versions.uv python list: View available Python versions.
uv python install 3.12Create New Project & Virtual environment
uv init <project_name>
uv venv --python 3.12
source .venv/bin/activateuv will create the following files:
.
βββ .python-version
βββ README.md
βββ main.py
βββ pyproject.tomlThe
pyproject.tomlcontains metadata about your project:It is similar with
package.json
uv.lockis a cross-platform lockfile that contains exact information about your project's dependencies. Unlike thepyproject.tomlwhich is used to specify the broad requirements of your project, the lockfile contains the exact resolved versions that are installed in the project environment. This file should be checked into version control, allowing for consistent and reproducible installations across machines.Similar with
package-lock.json
The .python-version file contains the project's default Python version. This file tells uv which Python version to use when creating the project's virtual environment.
Managing Dependencies
There are many ways to install package, after adding package,
pyproject.tomlanduv.lockwill be updateduv is compatible to pip
Tool
Tools are Python packages that provide command-line interfaces.
Similar with
npm install <package> -g
Docker file
Last updated
Was this helpful?