Bundle Python projects and all pip dependencies into a portable archive for offline, air-gapped deployment.
Project description
VenvDrop
Deploy massive Python environments — torch, llama_cpp, anything — to completely offline, air-gapped machines without breaking paths or triggering compiler errors.
VenvDrop uses the Offline Wheelhouse method: pip download fetches pre-built binary wheels on your internet-connected machine and zips them — along with your source code and platform metadata — into a single portable archive. On the target machine a single venvdrop unpack command creates a fresh virtual environment and installs everything entirely offline.
Installation
pip install venvdrop
Adds the venvdrop command globally — no virtual environment activation required.
venvdrop --version # venvdrop 0.1.0
venvdrop --help # full usage
Quick Start
Step 1 — Pack (internet-connected machine)
Option A: Download everything fresh
venvdrop pack \
--requirements requirements.txt \
--source ./src \
--output my_app.zip
Option B: Reuse your existing venv (faster — no re-download)
venvdrop pack \
--requirements requirements.txt \
--source ./src \
--output my_app.zip \
--from-venv .venv
VenvDrop reads pip's local wheel cache from the venv, collects everything offline, and only downloads packages genuinely missing from the cache.
Step 2 — Transfer
Copy my_app.zip to the target machine via USB, shared drive, SCP, etc.
Step 3 — Unpack (offline / air-gapped machine)
venvdrop unpack \
--archive my_app.zip \
--dest ./deployed_app
Then activate and run:
# Windows
.\deployed_app\venv\Scripts\activate
# Linux / macOS
source ./deployed_app/venv/bin/activate
Commands & Flags
venvdrop pack — Create a deployment archive
| Flag | Short | Default | Description |
|---|---|---|---|
--requirements |
-r |
requirements.txt |
Path to pip requirements file |
--source |
-s |
. |
Root directory of project source code |
--output |
-o |
app_bundle.zip |
Output archive filename |
--from-venv |
(none) | Reuse an existing venv's pip wheel cache |
What pack does:
- AST-scans every
.pyfile for hardcoded absolute paths — warns before bundling - Downloads all pip dependencies as pre-built binary wheels (or reuses from cache)
- Detects source distributions (
.tar.gz) that would require a compiler on the target - Embeds platform metadata (Python version, OS, CPU arch) →
bundle_meta.json - Generates SHA-256 checksums for all bundled files →
manifest.json - Creates the ZIP containing:
bundle_cache/+source/+requirements.txt+ metadata
Auto-excluded from source:
venv/, .venv/, .git/, __pycache__/, node_modules/, dist/, build/, .pytest_cache/, .mypy_cache/, .pyc, .pyo, .pyd, .so, .dll
venvdrop unpack — Deploy on the offline machine
| Flag | Short | Default | Description |
|---|---|---|---|
--archive |
-a |
(required) | Path to the .zip created by venvdrop pack |
--dest |
-d |
./deployed_app |
Destination directory |
What unpack does:
- Reads
bundle_meta.json— validates OS, CPU architecture, Python version - Auto-discovers matching Python interpreter if version mismatches (prompts if not found)
- Windows MAX_PATH guard — warns if destination path > 200 chars
- Venv collision handling — interactive: Overwrite / Backup / Abort
- Extracts archive and verifies SHA-256 integrity of every bundled file
- Creates a fresh
venv/using the correct Python interpreter - Upgrades pip inside the new venv (prevents PEP 517 compatibility issues)
- Installs all packages offline:
pip install --no-index --find-links bundle_cache/ - Prints a post-install checklist for system-level dependencies (CUDA, VC++ Redist, etc.)
What Problems Does VenvDrop Solve?
| Problem | How VenvDrop Handles It |
|---|---|
| No internet on target machine | Downloads all wheels upfront; installs with --no-index |
| Re-downloading slow / wasteful | --from-venv reuses pip's local wheel cache — no download needed |
| Source distribution / compile trap | Detects .tar.gz sdists and warns: use --only-binary=:all: |
| Hardcoded absolute paths | AST-scans every .py file and warns before bundling |
| Python version mismatch | Auto-discovers the right interpreter via py -3.x (Windows) or python3.x (Unix) |
| OS / arch mismatch | Blocks deployment if wheels won't run (e.g. x86_64 → ARM) |
| Windows MAX_PATH (260 chars) | Warns if destination path exceeds 200 characters |
| Windows command-line too long | Wheel cache is staged into a single flat dir; one --find-links arg |
| Existing venv collision | Interactive prompt: Overwrite / Backup / Abort |
| Bundle corruption in transit | SHA-256 manifest verified on every unpack |
| Outdated pip in new venv | Bootstraps pip install --upgrade pip before offline install |
| Missing system drivers | Post-install checklist: CUDA, VC++ Redistributable, OpenSSL, ODBC |
Why Not Just Copy the venv Folder?
Copying a venv directory breaks because:
- Absolute paths baked into scripts and
.pthfiles point to the source machine - Native extensions (
.pyd,.so) are compiled for a specific OS + arch - The Python interpreter path inside the venv is hardcoded
VenvDrop creates a fresh venv on the target machine and populates it from pre-built wheels, so all paths are correct from the start.
Troubleshooting
| Issue | Fix |
|---|---|
| sdist warning during pack | Re-run pip download with --only-binary=:all: |
| Python version mismatch | Install required Python on target; VenvDrop will prompt for path |
| OS / arch mismatch on unpack | Pack on a machine that matches the target OS and CPU |
| Windows MAX_PATH error | Choose a shorter --dest, e.g. C:\app |
bundle_meta.json missing |
Archive wasn't created by VenvDrop; re-pack with venvdrop pack |
| Integrity check failures | Archive was corrupted in transit; re-transfer the ZIP |
--from-venv can't find python |
Pass the venv ROOT (folder containing Scripts/ or bin/) |
Requirements
- Python ≥ 3.8
- Zero runtime dependencies — pure Python stdlib only
Development
git clone https://github.com/ashtharthasarathi/venvdrop.git
cd venvdrop
pip install -e . # editable install — changes apply immediately
venvdrop --version
See CONTRIBUTING.md for full dev guide and PyPI release steps.
License
MIT — see LICENSE.
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 venvdrop-0.1.0.tar.gz.
File metadata
- Download URL: venvdrop-0.1.0.tar.gz
- Upload date:
- Size: 21.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3f1745ac92e9ccd2a679567aea93b15e13fa627c85326d3d6ed0cb080b58ff2
|
|
| MD5 |
4951bbb6c468f33d972f26c8740be154
|
|
| BLAKE2b-256 |
ed08affae3c99b974385878dc66d9ed4d68e11d1a535646a6494eda7fbb069e4
|
File details
Details for the file venvdrop-0.1.0-py3-none-any.whl.
File metadata
- Download URL: venvdrop-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12a9e69d6ee1b679b2d88f56532723d1f99c3352bff13bc0fecf19f0de67d029
|
|
| MD5 |
52c9bd36d42cd1c3969fe450eb1f299c
|
|
| BLAKE2b-256 |
3e35d7844068b9493bc73a4498d8199fe6fe5cf2c81fc80e38db683d6909d507
|