ZuZhuang -- Assemble Portable Python Environments
ZuZhuang (组装) assembles portable, self-contained Python environments for any operating system. Download a Python release, install your packages, unpack, set a few environment variables, and you're ready to go.
Features
- Cross-platform: build portable Python for Windows, macOS, and Linux
- Self-contained: the output directory is fully portable - copy it to a USB drive, network share, or another machine
- Package installation: automatically install pip and any packages you need
- Activation scripts: generates
activate.bat(Windows) andactivate.sh(macOS/Linux) for one-command setup - Python versions: lists all available versions from python.org
Requirements
- Python 3.9+
- git, make, gcc, and libssl-dev (Linux builds only)
Installation
pip install zuzhuang
Quick Start
# List available Python versions
zuzhuang list-python
# Build a portable Python 3.12.6 environment with numpy and pandas
zuzhuang build 3.12.6 --packages numpy,pandas -o ./my-python
# Activate the environment
# Windows: my-python\activate.bat
# macOS/Linux: source my-python/activate.sh
# Run Python
python -c "import numpy; print(numpy.__version__)"
Usage
CLI
zuzhuang build <version> -o <output_dir> [options]
zuzhuang list-python [options]
Build Options
| Flag | Description |
|---|---|
-o, --output |
Output directory (required) |
-p, --packages |
Comma-separated pip packages |
--target |
Target OS: windows, macos, or linux (auto-detect) |
--force |
Overwrite existing output directory |
--json |
Output as JSON |
-v, --verbose |
Verbose output |
Python API
from zuzhuang import zuzhuang_build, zuzhuang_list_python
# List available versions
result = zuzhuang_list_python(target_os="windows")
print(result.data["versions"])
# Build a portable environment
result = zuzhuang_build(
python_version="3.12.6",
packages=["numpy", "pandas"],
output_dir="./my-python",
)
print(result.success)
Development
pip install -e ".[dev]"
pytest
ruff check .
ruff format .
License
GPL-3.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
zuzhuang-0.1.0.tar.gz
(22.7 kB
view details)
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
zuzhuang-0.1.0-py3-none-any.whl
(22.1 kB
view details)
File details
Details for the file zuzhuang-0.1.0.tar.gz.
File metadata
- Download URL: zuzhuang-0.1.0.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
282712d35dc25b766c7c70182847a2223cd57a02be63b1338081e96dbdb172e9
|
|
| MD5 |
a7fc273cb88455c58f8e00f875e9b435
|
|
| BLAKE2b-256 |
fab31b4797554c0af0bf6ae3e8a1445ff5f63e0dd28cfab65df478f7676baff3
|
File details
Details for the file zuzhuang-0.1.0-py3-none-any.whl.
File metadata
- Download URL: zuzhuang-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
666002c2e2ede313a85bf9104316b49d88b945f1161498c0c8d64f64db2c0c93
|
|
| MD5 |
135494de69e06be6c2beadeaa129ac67
|
|
| BLAKE2b-256 |
df6862908e3759a8ae15a2591ecc2e634621dcd072e530dfbeec5373a1ecc5b2
|