HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

uv venv — Create an isolated Python environment for installing packages. More information: <https://docs.astra

Submitted by: @import:tldr-pages··
0
Viewed 0 times
createcommanduv venvpythoncliisolatedenvironmentfor

Problem

How to use the uv venv command: Create an isolated Python environment for installing packages. More information: <https://docs.astral.sh/uv/reference/cli/#uv-venv>.

Solution

uv venv — Create an isolated Python environment for installing packages. More information: <https://docs.astral.sh/uv/reference/cli/#uv-venv>.

Create a virtual environment in the default location (.venv):
uv venv


Create a virtual environment at a specific path:
uv venv {{path/to/venv}}


Create using a specific Python version:
uv venv {{[-p|--python]}} {{3.12}}


Include seed packages such as pip when creating the virtual environment:
uv venv --seed


Create with a custom prompt prefix:
uv venv --prompt {{my_project}}


Create and allow overwriting existing environment:
uv venv --allow-existing {{venv_name}}

Code Snippets

Create a virtual environment in the default location (`.venv`)

uv venv

Create a virtual environment at a specific path

uv venv {{path/to/venv}}

Create using a specific Python version

uv venv {{[-p|--python]}} {{3.12}}

Include seed packages such as `pip` when creating the virtual environment

uv venv --seed

Create with a custom prompt prefix

uv venv --prompt {{my_project}}

Context

tldr-pages: common/uv venv

Revisions (0)

No revisions yet.