def pack(name=None, prefix=None, output=None, format='infer',
arcroot='', dest_prefix=None,
parcel_root=None, parcel_name=None,
parcel_version=None, parcel_distro=None,
verbose=False, force=False,
compress_level=4, n_threads=1, zip_symlinks=False, zip_64=True,
filters=None, ignore_editable_packages=False,
ignore_missing_files=False):
"""Package an existing conda environment into an archive file.
Parameters
----------
name : str, optional
The name of the conda environment to pack.
prefix : str, optional
A path to a conda environment to pack.
Only one of ``name`` and ``prefix`` should be supplied.
output : str, optional
The path of the output file. Defaults to the environment name with a
suffix determined by the format; e.g. ``my_env.tar.gz``.
format : {'infer', 'zip', 'tar.gz', 'tgz', 'tar.bz2', 'tbz2', 'tar', 'parcel'}, optional
The archival format to use. By default, this is inferred from the output
file extension, and defaults to ``tar.gz`` if ``output`` is not supplied.
arcroot : str, optional
The relative path in the archive to the conda environment.
Defaults to ''.
dest_prefix : str, optional
If present, prefixes will be rewritten to this path before packaging.
In this case the ``conda-unpack`` script will not be generated.
parcel_root, parcel_name, parcel_version, parcel_distro : str, optional
(Parcels only) the root directory, name, version, and target
distribution of the parcel. The name and version will be embedded
into parcel metadata. The default values are:
- ``parcel_root``: ``/opt/cloudera/parcels``
- ``parcel_name``: the base name of the environment directory
- ``parcel_version``: the current date in ``YYYY.MM.DD`` format.
- ``parcel_distro``: ``el7``
It is important that ``parcel_root`` match the directory into which all
parcels are unpacked on your cluster. Neither ``parcel_name`` nor
``parcel_version`` may contain dashes. The final destination of the parcel
is assumed to be ``parcel_root/parcel_name-parcel_version``, and both
``arcroot`` and ``dest_prefix`` are set accordingly. The default filename
will be ``parcel_name-parcel_version-parcel_distro.parcel``.
verbose : bool, optional
If True, progress is reported to stdout. Default is False.
force : bool, optional
Whethe
【python】【打包conda环境】【conda_pack.pack】
于 2024-02-09 08:53:40 首次发布