# How to Manage Python Environments with uv Instead of venv and pip

DevFeed: [How to Manage Python Environments with uv Instead of venv and pip](<https://devfeed.tech/articles/how-to-manage-python-environments-with-uv-instead-of-venv-and-pip-121288.md>)

Original publisher: [Read original article](<https://towardsdatascience.com/how-to-manage-python-environments-with-uv-instead-of-venv-and-pip/>)

Author: Sara A. Metwalli

Published: 2026-11-06T15:00:00Z

Content type: tutorial

Language: en

Sources: [Towards Data Science](<https://devfeed.tech/sources/towards-data-science.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [pip](<https://devfeed.tech/topics/pip.md>), [Tool](<https://devfeed.tech/topics/tool.md>)

Tags: [astral](<https://devfeed.tech/tags/astral.md>), [code-sharing](<https://devfeed.tech/tags/code-sharing.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [dependency-management](<https://devfeed.tech/tags/dependency-management.md>), [editor-s-picks](<https://devfeed.tech/tags/editor-s-picks.md>), [environment](<https://devfeed.tech/tags/environment.md>), [environments](<https://devfeed.tech/tags/environments.md>), [pip](<https://devfeed.tech/tags/pip.md>), [programming](<https://devfeed.tech/tags/programming.md>), [python](<https://devfeed.tech/tags/python.md>), [run](<https://devfeed.tech/tags/run.md>), [uv](<https://devfeed.tech/tags/uv.md>), [venv](<https://devfeed.tech/tags/venv.md>)

## AI overview

Virtual environments isolate project dependencies, allowing separate projects to use different pandas versions without overwriting each other. With venv and pip, developers create and activate environments, install packages, export requirements, and maintain that dependency file themselves; recording packages does not guarantee identical behavior on every machine. uv combines environment creation, dependency resolution, Python version management, lockfiles, and project execution: `uv init` starts a project, `uv add` declares and resolves a dependency, `uv run` runs a command in the project environment while checking lockfile and environment sync, and `uv sync` recreates the environment from `pyproject.toml` and `uv.lock`. The article presents venv plus pip as suitable for learning, tutorials, small scripts, or restricted environments, and uv as useful for frequent project work and cross-machine synchronization. Existing-project migration may require testing legacy constraints and configuration.

## Source excerpt

A side-by-side walkthrough of venv plus pip and uv init, uv add, uv run, and uv sync, with a lockfile that recreates the project on another machine. The post How to Manage Python Environments with uv Instead of venv and pip appeared first on Towards Data Science.