Skip to main content

A minimal re-implementation of Python's venv module

Project description

microvenv

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.

Usage

python microvenv.py [path=".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 .venv.

For programmatic usage, use the runpy module to execute the script:

runpy.run_path("microvenv.py", run_name="__main__")

The contents of microvenv.py is also small enough to be passed in via the -c flag to python.

Differences compared to the venv module

The module operates similarly to py -m venv --symlinks --without-pip .venv, except that:

  • There are no activation scripts (execute python in the virtual environment directly).
  • Windows is not supported.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

microvenv-2023.0.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

microvenv-2023.0.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file microvenv-2023.0.0.tar.gz.

File metadata

  • Download URL: microvenv-2023.0.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for microvenv-2023.0.0.tar.gz
Algorithm Hash digest
SHA256 3e4c4663a27167fb0ba5a76b0980bfa3da545beec9cd145460da316b8633ca35
MD5 148cc519571f4e86ac1056f6089e9b16
BLAKE2b-256 faf8ddcc4daf7860fde7c813c592810eca77141cb4ef4b4a5d81218edfc7d3a8

See more details on using hashes here.

File details

Details for the file microvenv-2023.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for microvenv-2023.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d9969620882bb16c5ca56b454b0198fe39bc7ae285c2d702c8fd35ffca36bec
MD5 e674a041480945608d7fb82ac701ec5f
BLAKE2b-256 e3d27f1a0975664ad08ace696d4b2ab5bb66c80183d59dbdee2748d216d5ad28

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page