Setting up Python with UV#
We recommend using uv for managing Python versions and dependencies in this course. It is extremely fast and simplifies the workflow.
Installation#
Windows (PowerShell)#
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
macOS / Linux#
curl -LsSf https://astral.sh/uv/install.sh | sh
After installing, restart your terminal to ensure uv is in your PATH.
Setting up the Environment#
Clone the Repository and navigate to the project folder.
Create a Virtual Environment:
uv venvThis creates a
.venvfolder with a fresh Python installation.Activate the Environment (Optional but recommended):
Windows:
.venv\Scripts\activatemacOS/Linux:
source .venv/bin/activate
Install Dependencies:
uv pip install -r requirements.txt
Common Commands#
Run a script:
uv run script.pyAdd a package:
uv pip install pandasCheck installed packages:
uv pip freezeUpdate dependencies:
uv pip compile requirements.in -o requirements.txt(if using requirements.in)