# 使用 Homebrew, apt, Nix, dnf 安装 virtualenv

查看 virtualenv 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:virtualenv
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install virtualenv
```

  证据: local Homebrew formula metadata

### Linux

- Debian apt (92%):

```sh
sudo apt install virtualenv
```

  证据: Debian stable package indexes: virtualenv from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#virtualenv
```

  证据: nixpkgs package indexes: virtualenv from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- dnf (92%):

```sh
sudo dnf install python3-virtualenv
```

  证据: Fedora Rawhide package metadata: python3-virtualenv from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

## 软件包事实

- **软件包键:** brew:virtualenv
- **软件包管理器:** Homebrew
- **版本:** 21.7.1
- **来源摘要:** Tool for creating isolated virtual python environments
- **主页:** <https://virtualenv.pypa.io/>
- **仓库:** <https://github.com/pypa/virtualenv>
- **最后更新:** 2026-07-31T16:35:46Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- virtualenv (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 21.7.1
## 项目历史与用法

virtualenv is one of the foundational Python packaging tools: it creates isolated Python environments so projects can have their own interpreter-facing package directories instead of sharing a global site-packages. The Python Packaging Authority history records virtualenv as introduced by Ian Bicking in 2007, and PEP 405 later described third-party virtualenv as the established predecessor to Python's standard-library venv module.

### 项目历史

virtualenv grew out of Ian Bicking's earlier workingenv and virtual-python work. Legacy virtualenv documentation describes it as a successor to workingenv and an extension of virtual-python, written by Bicking with sponsorship from The Open Planning Project and later maintained by a developer group under the PyPA umbrella.

The first PyPI files for virtualenv date to September 2007, and the legacy changelog records v0.8 as the initial release. In 2012, Python accepted PEP 405 for built-in virtual environments, explicitly citing the popularity of Ian Bicking's virtualenv as evidence that environment isolation was already a core Python workflow.

The project continued after venv entered the standard library because virtualenv supported more interpreter discovery modes, older Python versions, cross-platform activation scripts, and bundled or seeded installer behavior. The 20.x line was a major modernization of the implementation and seeding model, and recent changelogs show the project still tracking new Python versions and packaging behavior.

### 采用历史

virtualenv became a default building block for Python application development, testing, and deployment before Python had a built-in equivalent. PEP 405 described virtual environments as already widely used for dependency management, non-admin package installation, and automated testing across Python versions.

Its adoption is tightly linked to pip and PyPA packaging culture. For years, tutorials, CI systems, tox configurations, and distribution packaging recipes assumed that creating a throwaway virtualenv was the ordinary way to test Python code without contaminating the system interpreter.

### 使用方式

The common workflow is to run `virtualenv ENV`, activate the environment with the shell-specific activation script, and then install dependencies with pip into that isolated prefix. Modern virtualenv can also select interpreters, delegate some creation paths to venv, and seed environments with packaging tools according to its configured policy.

Even where `python -m venv` is sufficient, virtualenv remains useful when users want faster creation, broader interpreter support, consistent behavior across platforms, or compatibility with older packaging workflows. It is also embedded indirectly in higher-level tools that create disposable environments for testing, building, or application isolation.

### 为什么软件包爱好者会关心

virtualenv is package-nerd bedrock: it changed Python packaging from a global-machine problem into a per-project directory problem. Much of the later Python tooling stack, including virtualenvwrapper, tox, pipenv, Poetry, nox, and uv-style environment workflows, either builds on the same isolation idea or interoperates with its directory conventions.

### 时间线

- 2007: virtualenv was introduced by Ian Bicking.
- 2007-09-14: The earliest virtualenv files currently listed on PyPI were uploaded.
- 2012: PEP 405 proposed Python's standard-library virtual environments, citing virtualenv's established popularity.
- 2020: virtualenv 20.x became the modern line with a rewritten creation and seeding architecture.
- 2026: The active 21.x line continues to track current Python packaging and interpreter changes.

### Related projects

- workingenv and virtual-python were direct predecessors. Python's standard-library venv module standardized a subset of the virtual-environment concept. virtualenvwrapper and VirtualFish are shell-oriented managers built around virtualenv-style environments.

### 来源

- PEP 405: https://peps.python.org/pep-0405/
- PyPA packaging history: https://www.pypa.io/en/latest/history/
- virtualenv PyPI project: https://pypi.org/project/virtualenv/
- virtualenv changelog: https://virtualenv.pypa.io/en/latest/changelog.html
- virtualenv legacy changelog: https://virtualenv.pypa.io/en/legacy/changes.html
- virtualenv legacy development documentation: https://virtualenv.pypa.io/en/legacy/development.html


## 安全说明

没有找到 virtualenv 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。



## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: platformdirs app config directory/virtualenv.ini
- Windows: platformdirs app config directory/virtualenv.ini
## 其他软件包管理器记录

- Debian apt - virtualenv - 20.31.2+ds-1+deb13u1: normalized package name match | Debian stable package indexes: virtualenv from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Python virtual environment creator (Dependency package) | https://virtualenv.pypa.io/
- Nix - virtualenv: normalized package name match | nixpkgs package indexes: virtualenv from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - virtualenv - 20.25.0+ds-2: normalized package name match | Ubuntu 24.04 LTS package indexes: virtualenv from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Python virtual environment creator (Dependency package) | https://virtualenv.pypa.io/
- dnf - python3-virtualenv - 21.6.1-2.fc45: normalized package name match | Fedora Rawhide package metadata: python3-virtualenv from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Tool to create isolated Python environments | http://pypi.python.org/pypi/virtualenv


## Combined YAML source

View the package source record on GitHub. [combined/virtualenv.yml](https://github.com/mxcl/pkgdb/blob/main/combined/virtualenv.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
