A minimal re-implementation of Python's venv module
Create a minimal virtual environment.
This module is meant for when the
venv module has been removed from the standard library by your Python distribution. Because
venv is not available on PyPI and is developed in the stdlib, it is not possible to install it using
pip or simply copy the code and expect it to work with older versions of Python. This module then attempts to be that portable alternative for creating virtual environments.
In general, though, using the
venv module should be preferred and this module is only used as a fallback.
python microvenv.py [env_dir=".venv"]
If an argument is provided to the script, it is used as the path to create the virtual environment in. Otherwise, the virtual environment is created in
For programmatic usage, there is the
create() function, which is analogous to the
def create(env_dir: os.PathLike[str] | str = ".venv") -> None
microvenv.py file is also small enough to have its contents passed in via the
-c flag to
Differences compared to the
The module operates similarly to
py -m venv --symlinks --without-pip .venv,
- There are no activation scripts (you can execute
pythonin the virtual environment directly)
- Windows is not supported
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for microvenv-2023.2.0-py3-none-any.whl