Skip to main content

A tool to create virtual environments using an embedded Python interpreter.

Project description

portableenv

portableenv creates virtual environments from an embedded Python runtime that is cached under your user profile. Its goal is deterministic, isolated environments that do not silently drift when system Python changes.

Key behavior

  • Uses embedded CPython runtime archives from python.org.
  • Tracks runtime identity with implementation + version + abi + platform (for example cpython-3.10.9-cp310-win_amd64).
  • Writes runtime metadata for embedded runtimes and environment metadata for created environments.
  • Runs a post-create health check (doctor) to detect ABI drift (for example cp310 binaries inside a cp314 env).
  • Defaults to --copies for stronger isolation.

Version request heuristic

  • If you request a patch version (for example 3.11.5), portableenv tries that exact version first, then other discovered 3.11.x patches.
  • If you request a minor version (for example 3.11), portableenv probes available patch versions (3.11.x) and tries them in order.
  • If no usable embedded 3.11.x runtime is found, it falls back to the current system Python interpreter.
  • You can still force system fallback at any time with --allow-system-fallback.

Installation

pip install portableenv

Usage

Create an environment

python -m portableenv myenv

Pin a specific Python version

python -m portableenv myenv -v 3.10.9

Request a minor line and let portableenv choose a patch

python -m portableenv myenv -v 3.11

Explicit system fallback control

python -m portableenv myenv -v 3.10.9 --allow-system-fallback

Use symlinks instead of copies

python -m portableenv myenv -v 3.10.9 --symlinks

Validate an environment (doctor mode)

python -m portableenv myenv --doctor

If ABI mismatches are found, recreate the environment with a consistent runtime.

Notes

  • Existing environments are not modified in place.
  • If an embedded runtime setup fails and no fallback route is allowed/applicable, creation fails fast.

Requirements

  • Python 3.7 or higher
  • virtualenv (installed automatically inside the selected runtime)
  • Internet connection for first-time runtime and pip bootstrap downloads

License

MIT License. See LICENSE.

Links

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

portableenv-2.0.5.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

portableenv-2.0.5-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file portableenv-2.0.5.tar.gz.

File metadata

  • Download URL: portableenv-2.0.5.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for portableenv-2.0.5.tar.gz
Algorithm Hash digest
SHA256 8099bcf74f8c76a51275863c2ba4b3370d9ee8fed8501dad2fcaec5f74aa77cf
MD5 60c7c9ab5b026568e827a89b17265b2d
BLAKE2b-256 4bf8112ef307a314a419f59a602e253b8fc721872a8740eedd7d38633fbadd29

See more details on using hashes here.

File details

Details for the file portableenv-2.0.5-py3-none-any.whl.

File metadata

  • Download URL: portableenv-2.0.5-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for portableenv-2.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f17e4d2cbbdda6656476b5dc64d4356205eac66c08d12615fd9d30a3c0532a2b
MD5 3a4bf9faf8090ae9ab7a64b9afde6c9b
BLAKE2b-256 fd9e730d99aa44a03283158372a1bacfcef12fa598a53f7c0fc5c5c3fd882026

See more details on using hashes here.

Supported by

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