skillfed

virtualenv-clone

script to clone virtualenvs.

virtualenv-clone v0.5.7 1.7M downloads/30d#3,644 on PyPI224
Permissive license MIT AGING released

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-clone

uv

uv add virtualenv-clone

poetry

poetry add virtualenv-clone

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

clone virtualenvcopy virtualenv to new locationvirtualenv relocationduplicate python environmentvirtualenv migrationcopy virtual environmentvirtualenv backup
virtualenv-managementenvironment-cloning

More Build Tools packages