Python and UV
Python
Section titled “Python”Properly set up your pyproject.toml to make your life eaiser.
Astral UV
Section titled “Astral UV”Astral UV simplifies the creation, use, and maintenence of virutal environments.
Install it using
curl -LsSf https://astral.sh/uv/install.sh | shInstall a specific Python verison using
uv python install x.yzInitialize a Python project using uv with
uv initUse
--python x.yzto specify a Python version.
Add a virtual environment to an existing project using uv with
uv venvUse
--python x.yzto specify a Python version.
Activate the environment using
source ./.venv/bin/activateUse
uv add packagenameto install Python packages. If your
pyproject.tomlis set up correctly, then you can just use
uv syncto install all dependencies.
Run Python files with
uv run filename.py