virtualenv-clone
script to clone virtualenvs.
What it is and what it does
virtualenv-clone is a utility script that copies a Python virtualenv from one location to another while preserving its isolation and functionality. Unlike virtualenv's built-in `--relocatable` flag, which can break site-packages isolation and introduce issues with relative paths, this tool takes a more thorough approach: it copies the entire environment directory, updates hardcoded paths in the activate script, rewrites shebangs in bin scripts to point to the new Python interpreter, and scans sys.path to find and update any absolute references in .pth and .egg-link files that still point to the old location.
The package is designed for developers who need to duplicate virtualenvs—for backup, migration, or testing purposes—without the pitfalls of the standard relocation mechanism. It has no runtime dependencies and installs with low friction, making it straightforward to add to any workflow. However, the codebase has not seen active development since 2021, so it may not account for changes in newer Python or virtualenv behavior.
Use it for:
- Back up a working virtualenv before making experimental changes to dependencies.
- Migrate a virtualenv from one machine or filesystem to another while preserving all installed packages.
- Clone a development environment for testing or sharing with team members.
- Duplicate a production-like virtualenv for local debugging without affecting the original.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Clones an existing Python virtualenv to a new location, updating shebangs, paths, and environment variables to work correctly in the new location without breaking isolation.
Yes, if you need to copy a virtualenv and the aging codebase is not a concern for your Python version and use case. The package is lightweight, has no dependencies, and solves a real problem that the standard virtualenv tools do not. However, verify compatibility with your specific Python version and virtualenv setup before relying on it in production, given the lack of recent updates.
Install
virtualenv-clone on PyPI
pip
pip install virtualenv-cloneuv
uv add virtualenv-clonepoetry
poetry add virtualenv-cloneInstalling virtualenv-clone
Before you install
Low install friction with no runtime dependencies. Maintenance is aging—last release was in 2021 and the repository has not been updated since May 2025, though it remains active and unarchived.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install virtualenv-clone
python -m virtualenv_clone /path/to/old/venv /path/to/new/venv
Requires Python 2.7 or 3.4+; the clone operation modifies shebangs and .pth files in the target virtualenv, so ensure the source virtualenv is not in use during cloning.
Verify before relying
- Whether the package works correctly with modern virtualenv versions and current Python patch releases.
- Whether the aging codebase handles edge cases in recent Python or setuptools changes.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 1,802 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,696,353/month — #3,644 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: virtualenv_clone-0.5.7-py3-none-any.whl
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
pipenvPipenv automates Python virtual environment…
permissive · top 1,000 on PyPI
relenvRelenv builds self-contained, reproducible…
unclear · top 15,000 on PyPI
selinuxProvides a pure-Python shim for the selinux…
permissive · top 5,000 on PyPI
rpmProvides access to system RPM Python bindings…
permissive · top 15,000 on PyPI
conda-packconda-pack creates relocatable conda…
permissive · top 15,000 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
nodeenvnodeenv creates isolated Node.js environments…
permissive · top 1,000 on PyPI
locateProvides utilities to locate the current Python…
unclear · top 5,000 on PyPI
virtualenvwrapperProvides shell command wrappers and hooks to…
permissive · top 15,000 on PyPI
pynvimPynvim is a Python client library that enables…
permissive · top 15,000 on PyPI