Skip to content

Instantly share code, notes, and snippets.

@docPhil99
Last active February 24, 2026 16:11
Show Gist options
  • Select an option

  • Save docPhil99/68a144d298efd796fa0b3b90ca5c11a8 to your computer and use it in GitHub Desktop.

Select an option

Save docPhil99/68a144d298efd796fa0b3b90ca5c11a8 to your computer and use it in GitHub Desktop.
uv basics

Create a project uv init. This create the project files

  • uv venv creates the actual .venv environment.
  • uv venv --python 3.11.6 use specific python version
  • uv add Add a dependency to the project.
    • uv add 'requests==2.31.0' specific version
    • uv add -r requirements.txt add requirements.txt
  • uv remove Remove a dependency from the project.
  • uv sync Sync the project's dependencies with the environment.
  • source .venv/bin/activate activate the environment. Run sync first.

Working with Pytorch and CUDA

If an old version of torch is needed, check the CUDA requirements: https://pytorch.org/get-started/previous-versions/ I'm going to user 1.10.1 which uses CUDA 11.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment