Skip to content

Instantly share code, notes, and snippets.

@kashifulhaque
Last active August 24, 2025 16:55
Show Gist options
  • Save kashifulhaque/0a45be806a2abd05c919316cf8b55986 to your computer and use it in GitHub Desktop.
Save kashifulhaque/0a45be806a2abd05c919316cf8b55986 to your computer and use it in GitHub Desktop.
Some commonly used `uv` commands

Python uv commands

  • uv init dir_name will create a new python project
    • uv init . in an existing project directory
  • uv run script.py will run script.py. No need to activate venv, uv will take care of it
  • uv add lib_name will pull lib_name from pypi and add it to project
  • uv remove lib_name will remove lib_name from the env
  • uv lock will generate a lockfile
  • uv sync will make the venv in sync with lockfile, installing and removing as required
    • uv pip install -r requirements.txt in an existing project directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment