conda pack是一个命令行工具,用于将Conda环境打包成一个可移植的tarball文件。以下是conda pack命令的选项:

usage: conda pack [-h] [-n ENVIRONMENT | -p PATH] [-o OUTPUT_PATH] [--zip] [--arcroot ARCROOT] [--compress-level {0,1,2,3,4,5,6,7,8,9}] [--ignore-softlinks] [--ignore-editable-packages] [--exclude-files EXCLUDE_FILES] [--follow-external-links] [--follow-softlinks] [--no-archive-cache] [--no-compress-cache] [--no-update-dependencies] [--no-update-specs] [--no-include-recipe] [--no-prefix-replacement] [--no-relative-path-replacement] [--no-strip-files] [--no-verify] [--exclude-source-files] [--exclude-vcs-files] [--all-packages] [--force] [--verbose] [--quiet]

Options:
  -h, --help            show this help message and exit
  -n ENVIRONMENT, --name ENVIRONMENT
                        Name of the conda environment to pack.
  -p PATH, --path PATH  Path to the conda environment to pack.
  -o OUTPUT_PATH, --output-path OUTPUT_PATH
                        Path to the tarball file to create. If not specified, the tarball will be created in the current directory.
  --zip                 Pack the environment as a zip file instead of a tarball.
  --arcroot ARCROOT     Path to the location where the environment will be unpacked. Defaults to /opt/anaconda.
  --compress-level {0,1,2,3,4,5,6,7,8,9}
                        Compression level to use when creating the tarball. Defaults to 9.
  --ignore-softlinks    Ignore softlinks when packing the environment.
  --ignore-editable-packages
                        Ignore editable packages when packing the environment.
  --exclude-files EXCLUDE_FILES
                        List of files to exclude from the packed environment.
  --follow-external-links
                        Follow external links when packing the environment.
  --follow-softlinks    Follow softlinks when packing the environment.
  --no-archive-cache    Do not include the archive cache in the packed environment.
  --no-compress-cache   Do not compress the cache in the packed environment.
  --no-update-dependencies
                        Do not update dependencies when packing the environment.
  --no-update-specs     Do not update the environment specifications when packing the environment.
  --no-include-recipe   Do not include the recipe used to create the environment in the packed environment.
  --no-prefix-replacement
                        Do not replace the environment prefix in the packed environment.
  --no-relative-path-replacement
                        Do not replace relative paths in the packed environment.
  --no-strip-files      Do not strip files when packing the environment.
  --no-verify           Do not verify the hash of the packed environment.
  --exclude-source-files
                        Exclude source files when packing the environment.
  --exclude-vcs-files   Exclude version control system files when packing the environment.
  --all-packages        Pack all packages, including non-conda packages.
  --force               Overwrite the output file if it already exists.
  --verbose             Print verbose output.
  --quiet               Suppress all output except for errors and warnings.

其中,常用的选项包括:

  • -n--name:指定要打包的环境的名称;
  • -p--path:指定要打包的环境的路径;
  • -o--output-path:指定打包后的tarball文件的路径;
  • --zip:将环境打包成zip文件;
  • --exclude-files:指定要排除的文件列表;
  • --all-packages:打包所有包,包括非conda包;
  • --force:如果已存在输出文件,则覆盖它。
conda pack命令选项

原文地址: https://www.cveoy.top/t/topic/unN 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录