Back to Module 3 | Back to Table of Contents
uv is a Python package management and virtual environment tool developed with Rust. Its objectives are very clear:
It's not easy for Python to rely on management.
You can read uv as a combination of pip, venv, pip-tools.
Install uv:
curl -LsSf https://astral.sh/uv/install.sh | shUpon installation, confirm:
uv --versionuv can easily manage several Python versions without additional tools such as pyenv.
View available Python versions:
uv python listThe uv python command 3.11 can install a specific version of Python.
uv venv .opencv --python 3.10.12Of which .opencv is the name of the virtual environment; 3.10.12 is a python version of the virtual environment.
source .venv/bin/activate# Install new packages:
uv pip install opencv-python
# uv pip install -r requirements.txt
# Uninstall packages:
uv pip uninstall requests
# Export the dependencies of the current environment
uv pip freeze > requirements.txt