Skip to main content

This module provides functionality to pack conda environments and their dependencies into a specified directory.

Project description

PACKING-PACKAGES

CI docs release-pypi

Ruff mypy

python_badge license_badge PyPI version Downloads

This module provides functionality to pack conda environments and their dependencies into a specified directory.

You can use this package to migrate a conda 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.

Pack

packing-package pack -d .

Install

packing-package install .

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/*

Notes

Installing PyTorch from a Non-PyPI Source

If you want to use pip 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 must be handled manually. This process is complex, and automated support is not currently provided.

# 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, you may be able to install them manually using the --use-pep517 option:

pip install <package-name> --use-pep517

Choosing Between Standard Install Commands and packing-package install

There are two main methods for installing packages:

  1. Using conda install or pip install
  2. Using the packing-package install command, which wraps these tools and provides error handling
Command Advantages Disadvantages
conda install / pip install Fast execution Stops immediately upon error
packing-package install Skips failed packages and reports them Slower installation 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:

# On an online machine with the same OS
conda env create -f=env_name.yml
conda activate <env_name>
python3 -m pip install packing-packages
packing-packages pack -d .

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

packing_packages-0.1.1rc0.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

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

packing_packages-0.1.1rc0-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file packing_packages-0.1.1rc0.tar.gz.

File metadata

  • Download URL: packing_packages-0.1.1rc0.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for packing_packages-0.1.1rc0.tar.gz
Algorithm Hash digest
SHA256 e2216b81322fd1b21ecf75deb8e137570023b3c1c229ef158fbb3b5dd35da9a9
MD5 8e138b8940ce0d6b748460e359907805
BLAKE2b-256 9ebd3fe9c2f6cc6a2e98550d9278bf0287159659fa8941ccd19cbf8ac8dd6b7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for packing_packages-0.1.1rc0.tar.gz:

Publisher: release-pypi.yml on yu9824/packing-packages

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file packing_packages-0.1.1rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for packing_packages-0.1.1rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa01ec1b5b57705959245c766c1342935d1fa3a1cc69828a9b1390e6a17a2755
MD5 7f1ec79960aeac7b6ff62fda3f26f96c
BLAKE2b-256 ea793e7cd23dd4604bff0d7146596678723e551791d02be7df805f795f55a167

See more details on using hashes here.

Provenance

The following attestation bundles were made for packing_packages-0.1.1rc0-py3-none-any.whl:

Publisher: release-pypi.yml on yu9824/packing-packages

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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