Docs: uv Docs
cd your-project
uv venv # Creates .venv in project directory
source .venv/bin/activate # or: . .venv/bin/activate
uv pip install pandas numpyAdvantages over managing with conda: conda can introduce dependency duplication. uv uses aggressive caching to avoid re-downloading (and re-building) dependencies that have already been accessed in prior runs. Let’s say two projects are using the same ‘pandas’ version. Even if you have a separate environments for the projects, uv does not install the dependency twice (like it would do with conda environments).
uv commands:
Install uv (first time):
curl -LsSf https://astral.sh/uv/install.sh | shSetup project:
uv init && uv venv --python 3.12Activate environment:
source .venv/bin/activateInstall project in editable mode:
uv pip install -e .Add dependencies:
uv add pandasAdd dependencies (pip compatibility):
uv pip install pandasRunning scripts
uv run example.pyUsing Jupyter from VS Code
Create a project.
uv init project
Move into the project directory.
cd project
Add ipykernel as a dev dependency.
uv add --dev ipykernel
Open the project in VS Code.
code .