This module provides functionality to pack conda environments and their dependencies into a specified directory.
Project description
PACKING-PACKAGES
This tool packs a conda environment and all its dependencies into a directory.
You can migrate the packed environment to another offline machine with the same operating system.
Install
# Need python, setuptools, pip package
pip install packing-packages
How to use
See help for available commands and options:
packing-packages --help
packing-packages pack --help
packing-packages install --help
Pack
packing-packages pack -d .
Install
packing-packages install .
Generate install scripts (instead of installing directly)
Use --generate-scripts to create reusable install scripts that do not depend on this package. These scripts can be copied and executed on another machine (offline), and work across platforms (Windows batch and Unix/Linux shell).
# Generate scripts in the package directory (default)
packing-packages install . --generate-scripts
# Specify environment name and output directory explicitly
packing-packages install /path/to/packages \
--generate-scripts \
--env-name myenv \
--output-dir /path/to/output
Generated files:
- install_packages.bat (Windows)
- install_packages.sh (Unix/Linux)
Notes:
- If
--env-nameis omitted with--generate-scripts, the environment name defaults to the package directory name. - If
--output-diris omitted, scripts are written to the package directory.
Example
Source device
conda activate <envname>
python -m pip install packing-packages
python -m packing_packages pack -d .
Destination device (offline)
conda create -yn <envname> --offline
conda activate <envname>
conda install --use-local --offline ./conda/*
python -m pip install --no-deps --no-build-isolation ./pypi/*
Alternatively, if you generated install scripts on the source device:
# Windows
install_packages.bat
# Unix/Linux
./install_packages.sh
Notes
Installing PyTorch from a Non-PyPI Source
If you need to download packages from a source other than PyPI (e.g., the official PyTorch index), standard methods may not complete successfully. Some packages may fail to download and require manual handling. Automated support is not currently provided for that case.
# Installation command
pip install torch==2.5.1 --index-url https://download.pytorch.org/whl/cu124
# Download command (without dependencies)
# --no-deps: download only the specified package
# -d: set the destination directory
pip download torch==2.5.1 --index-url https://download.pytorch.org/whl/cu124 --no-deps -d .
Handling Installation Failures with --use-pep517
Some older packages may not install successfully using pip install. In such cases, installing with the --use-pep517 option may help:
pip install <package-name> --use-pep517
Choosing Between Standard Install Commands and packing-packages install
There are two main methods for installing packages:
- Using
conda installorpip install - Using the
packing-packages installcommand, which wraps these tools and provides error handling
| Command | Advantages | Disadvantages |
|---|---|---|
conda install / pip install |
Fast execution | Stops immediately upon error |
packing-packages install |
Skips failed packages and reports them | Slower overall process |
Packing an Environment Using a .yaml File
If you already have an environment file (.yaml), you can create and pack the environment on an online machine with the same OS:
You can now pack from a YAML file even on a different OS using the following command:
packing-packages pack yaml /path/to/file.yaml
Using a Proxy (If Required)
If you are in an environment that requires a proxy, you may need to configure the proxy settings before downloading or installing packages:
export HTTP_PROXY="your proxy"
export HTTPS_PROXY="your proxy"
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 packing_packages-0.3.1rc0.tar.gz.
File metadata
- Download URL: packing_packages-0.3.1rc0.tar.gz
- Upload date:
- Size: 25.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e059bcf6207e1d9cd84d5b8873ecc5758baa435a5a15a10413172dc9c2fadbb4
|
|
| MD5 |
c94d7c9e20e96c72f4c39c72ed6a36ef
|
|
| BLAKE2b-256 |
19e794781563f07de3724b9d838e6602f36660a862cca67903758407b473b432
|
Provenance
The following attestation bundles were made for packing_packages-0.3.1rc0.tar.gz:
Publisher:
release-pypi.yml on yu9824/packing-packages
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
packing_packages-0.3.1rc0.tar.gz -
Subject digest:
e059bcf6207e1d9cd84d5b8873ecc5758baa435a5a15a10413172dc9c2fadbb4 - Sigstore transparency entry: 709060522
- Sigstore integration time:
-
Permalink:
yu9824/packing-packages@39c7548715ece2fd699e1c7ed1638e37f1995a6f -
Branch / Tag:
refs/tags/v0.3.1-rc.0 - Owner: https://github.com/yu9824
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@39c7548715ece2fd699e1c7ed1638e37f1995a6f -
Trigger Event:
push
-
Statement type:
File details
Details for the file packing_packages-0.3.1rc0-py3-none-any.whl.
File metadata
- Download URL: packing_packages-0.3.1rc0-py3-none-any.whl
- Upload date:
- Size: 29.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
219498bc9ac8c9593750ad4c24dc584312c83bc211efa29052f8ee622d1f53e4
|
|
| MD5 |
8f423a151b39cf3bde7902b679e9e686
|
|
| BLAKE2b-256 |
5e569752cd0de296e5b254a29724c3e16aaa2ca3676464314c84c5ee010ec4fd
|
Provenance
The following attestation bundles were made for packing_packages-0.3.1rc0-py3-none-any.whl:
Publisher:
release-pypi.yml on yu9824/packing-packages
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
packing_packages-0.3.1rc0-py3-none-any.whl -
Subject digest:
219498bc9ac8c9593750ad4c24dc584312c83bc211efa29052f8ee622d1f53e4 - Sigstore transparency entry: 709060524
- Sigstore integration time:
-
Permalink:
yu9824/packing-packages@39c7548715ece2fd699e1c7ed1638e37f1995a6f -
Branch / Tag:
refs/tags/v0.3.1-rc.0 - Owner: https://github.com/yu9824
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@39c7548715ece2fd699e1c7ed1638e37f1995a6f -
Trigger Event:
push
-
Statement type: