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 examplecpython-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 examplecp310binaries inside acp314env). - Defaults to
--copiesfor stronger isolation.
Version request heuristic
- If you request a patch version (for example
3.11.5),portableenvtries that exact version first, then other discovered3.11.xpatches. - If you request a minor version (for example
3.11),portableenvprobes available patch versions (3.11.x) and tries them in order. - If no usable embedded
3.11.xruntime 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8099bcf74f8c76a51275863c2ba4b3370d9ee8fed8501dad2fcaec5f74aa77cf
|
|
| MD5 |
60c7c9ab5b026568e827a89b17265b2d
|
|
| BLAKE2b-256 |
4bf8112ef307a314a419f59a602e253b8fc721872a8740eedd7d38633fbadd29
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f17e4d2cbbdda6656476b5dc64d4356205eac66c08d12615fd9d30a3c0532a2b
|
|
| MD5 |
3a4bf9faf8090ae9ab7a64b9afde6c9b
|
|
| BLAKE2b-256 |
fd9e730d99aa44a03283158372a1bacfcef12fa598a53f7c0fc5c5c3fd882026
|