Plugins¶
virtualenv can be extended via plugins using Python entry points. Plugins are automatically discovered from the Python environment where virtualenv is installed, allowing you to customize how virtual environments are created, seeded, and activated.
Extension points¶
virtualenv provides four extension points through entry point groups:
virtualenv.discoveryPython interpreter discovery plugins. These plugins locate and identify Python interpreters that will be used as the base for creating virtual environments.
virtualenv.createVirtual environment creator plugins. These plugins handle the actual creation of the virtual environment structure, including copying or symlinking the Python interpreter and standard library.
virtualenv.seedSeed package installer plugins. These plugins install initial packages (like pip, setuptools, wheel) into newly created virtual environments.
virtualenv.activateShell activation script plugins. These plugins generate shell-specific activation scripts that modify the environment to use the virtual environment.
All extension points follow a common pattern: virtualenv discovers registered entry points, builds CLI options from them, and executes the selected implementations during environment creation.
- Your first plugin
- Plugin how-to guides
- Plugin API reference
- Discovery
Discover- PythonInfo
PythonInfoPythonInfo.install_path()PythonInfo.version_strPythonInfo.version_release_strPythonInfo.python_namePythonInfo.is_old_virtualenvPythonInfo.is_venvPythonInfo.sysconfig_path()PythonInfo.system_includePythonInfo.system_prefixPythonInfo.system_exec_prefixPythonInfo.machinePythonInfo.specPythonInfo.clear_cache()PythonInfo.satisfies()PythonInfo.current()PythonInfo.current_system()PythonInfo.to_json()PythonInfo.to_dict()PythonInfo.from_exe()PythonInfo.from_json()PythonInfo.from_dict()PythonInfo.resolve_to_system()PythonInfo.discover_exe()
- App data
- Creators
- Seeders
- Activators
- Discovery
- Plugin architecture