Skip to content

Latest commit

 

History

History
139 lines (104 loc) · 7.06 KB

README.md

File metadata and controls

139 lines (104 loc) · 7.06 KB

conda-standalone

A standalone conda executable built with PyInstaller.

What is this for?

conda-standalone is a self-contained conda installation produced with PyInstaller.

Warning

This product is not intended for end-users! Its main purpose is to assist constructor install the bundled conda packages.

Main features:

  • Single-file binary, named conda.exe, that can be mostly used as the regular conda command.
  • No installation required, but there are some differences (see below).
  • New subcommands (see below).

Installation

You can install conda-standalone like any other conda package. Note the binary will be only available under $PREFIX/standalone_conda/conda.exe, which is not in PATH.

$ conda create -n conda-standalone conda-standalone
$ conda activate conda-standalone
$ "$CONDA_PREFIX/standalone_conda/conda.exe" --help

You can also download the packages directly from anaconda.org and extract them manually:

Note

Use conda-package-handling's cph x command to extract .conda archives if needed.

Main differences

  • Slow startup. The binary needs to self extract into a temporary location and then run conda from there. On Windows, antivirus might delay everything even longer while the contents are analyzed.
  • No shell integration. It cannot activate or deactivate environments. You can use conda.exe run, though.
  • No implicit base environment. Always operate on an existing or new environment with --prefix / -p.
  • And maybe more. Please submit an issue if you find something that could be improved!

It also adds new subcommands not available on the regular conda:

conda.exe constructor

This subcommand is mainly used by the installers generated with constructor.

usage: conda.exe constructor [-h] [--prefix PREFIX] [--num-processors N]
                             [--extract-conda-pkgs | --extract-tarball | --make-menus [PKG_NAME ...] | --rm-menus]
                             {uninstall} ...

constructor helper subcommand

positional arguments:
  {uninstall}

options:
  -h, --help            show this help message and exit
  --prefix PREFIX       path to the conda environment to operate on
  --num-processors N    Number of processors to use with --extract-conda-pkgs. Value must be int between 0 (auto) and the
                        number of processors. Defaults to 3.
  --extract-conda-pkgs  extract conda packages found in prefix/pkgs
  --extract-tarball     extract tarball from stdin
  --make-menus [PKG_NAME ...]
                        create menu items for the given packages; if none are given, create menu items for all packages
                        in the environment specified by --prefix
  --rm-menus            remove menu items for all packages in the environment specified by --prefix

conda.exe constructor uninstall

This subcommand can be used to uninstall a base environment and all sub-environments, including entire Miniconda/Miniforge installations. It is also possible to remove environments directories created by conda create. This feature is useful if envs_dirs is set inside .condarc file.

There are several options to remove configuration and cache files:

$ conda.exe constructor uninstall [-h] --prefix PREFIX [--conda-clean] [--remove-config-files {user,system,all}]
                                  [--remove-conda-caches]
  • --prefix (required): Path to the conda directory to uninstall.
  • --remove-caches: Removes the notices cache and runs conda --clean --all to clean package caches outside the installation directory. This is especially useful when pkgs_dirs is set in a .condarc file. Not recommended with multiple conda installations when softlinks are enabled.
  • --remove-config-files {user,system,all}: Removes all .condarc files. user removes the files inside the current user's home directory and system removes all files outside of that directory. Not recommended when multiple conda installations are on the system or when running on an environments directory.
  • --remove-user-data: Removes the ~/.conda directory. Not recommended when multiple conda installations are installed on the system or when running on an environments directory.

Important

Use sudo -E if removing system-level configuration files requires superuser privileges. conda relies on environment variables like HOME and XDG_CONFIG_HOME when detecting configuration files, which may be overwritten with just sudo. This can cause files to be left behind.

Warning

Support for softlinks is still untested. The uninstaller will only perform unlink operations and not delete any files the links point to.

conda.exe python

This subcommand provides access to the Python interpreter bundled in the conda-standalone binary. It tries to emulate the same python CLI, but in practice it's just a convenience subset. The following options are supported:

$ conda.exe python --help
Usage: conda.exe python [-V] [-c cmd | -m mod | file] [arg] ...
  • -c <script>: Execute the Python code in <script>. You can also pipe things via stdin; e.g echo 'print("Hello World")' | conda.exe python.
  • -m <module>: Search sys.path for the named Python module and execute its contents as the __main__ module.
  • <file>: Execute the Python code contained in <file>.
  • -V, --version: Print the Python version number and exit.
  • No options: Enter interactive mode. Very useful for debugging. You can import all the packages bundled in the binary.

Build status

Build status pre-commit.ci status Anaconda-Server Badge
conda install defaults::conda-standalone Anaconda-Server Badge
conda install conda-forge::conda-standalone Anaconda-Server Badge
conda install conda-canary/label/dev::conda-standalone Anaconda-Server Badge