Python Project Setup with uv

Set up Python projects with uv for dependency management and environment configuration.

Updated Aug 15, 2023
One-click install
npx skills add https://github.com/connectwithprakash/dotfiles --skill python-project-setup-with-uv
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Python Project Setup with uv
Source: https://github.com/connectwithprakash/dotfiles/tree/main/.claude/skills/python-project-setup
Command: npx skills add https://github.com/connectwithprakash/dotfiles --skill python-project-setup-with-uv

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you bootstrap and configure Python projects using uv, covering environment setup, dependency management, and development tooling to accelerate onboarding.

Core Features & Use Cases

  • Environment setup: Creates and activates a virtual environment with uv, pinning Python version when needed.
  • Dependency management: Installs dependencies from requirements files or pyproject.toml, and adds dev tools.
  • Project scaffolding: Generates standard project structure and configuration files (pyproject.toml, .python-version).

Quick Start

Initialize a new Python project with uv in an empty directory by running uv init, then install dependencies and run tests.

Frequently Asked Questions about Python Project Setup with uv

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a Python project with uv instead of pip or venv?

uv is a fast Python package installer and resolver that replaces pip and virtualenv. Use `uv init` to create a new project with a virtual environment, `pyproject.toml`, and `.python-version` file, then `uv pip install` to add dependencies. uv handles environment creation, dependency locking, and Python version pinning in one workflow.

Can I migrate an existing Python project to use uv?

Yes. uv reads existing `requirements.txt` and `pyproject.toml` files directly. Run `uv pip install -r requirements.txt` to install dependencies into a uv-managed environment, or use `uv pip sync` to match exact versions. uv works alongside your current setup without replacing existing files.

How do I install development dependencies and tools with uv?

Define dev dependencies in `pyproject.toml` under `[project.optional-dependencies]` or use `uv pip install --editable .` for editable installs during development. uv installs and manages both production and development tools in the same virtual environment, supporting isolated tooling configuration.

What's the difference between uv and traditional Python virtual environments?

uv combines the speed of Rust with unified dependency resolution, replacing separate `venv`, `pip`, and `pip-tools` workflows. It locks dependency versions automatically, pins Python versions per project, and installs packages faster than pip, all managed through a single command interface.

Can I use uv with existing pyproject.toml and requirements.txt files?

Yes. uv automatically detects and reads both formats. It respects version constraints in `pyproject.toml` and can install from `requirements.txt` files or sync exact versions. You can mix formats—uv handles dependency resolution and environment setup regardless of which file stores your specifications.

Do I need Python already installed to use uv?

uv can download and manage Python versions automatically. Set your desired version in `.python-version` or `pyproject.toml`, and uv installs it on first run. This eliminates version conflicts across projects and simplifies onboarding for team members.