Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel7
typeflat
separatorpipe
Note

Note: Although performing a module purge will remove the miniconda3 module from your module list, it does not clean up the new/modified environment variables. This is due to them not being directly set by the module file, but rather by an addition script that was called.

Currently, you will need to start a new session if you want a clean environment.

Overview

Miniconda is a small, bootstrap version of Anaconda that includes only conda, Python, the packages they depend on, and a small number of other useful packages, including pip, zlib and a few others. It can also be used to start with a minimal set of installed packages, and then install only the required ones (to save space).

Training:

Info

ARCC provides the following workshops on using conda environments:

Using

Use the module name miniconda3 to discover versions available and to load the application.

Check the required dependencies for a particular version. For example, on teton version 4.9.2 has a dependency on gcc/7.3.0, while 4.10.3 does not.

Training:

ARCC’s training pages are currently under review/revision.

Note

When using miniconda3 via an interactive session (salloc) or submitting a script via sbatch, please make sure to explicitly load the miniconda3 module once you have your interactive session on the compute node, and within you bash script.

If you do not, you’ll see an error of the form: CondaError: Run 'conda init' before ...

Install Packages into a Miniconda Environment in Your Home Directory

The following commands are useful for creating and using environments in your home directory:

conda info --envs

show environments

conda create -n NAME

create an environment named NAME in your home related conda location.

conda create -n NAME python=3.4

create an environment named NAME, with specified Python version

conda create -p NAME

create an environment named NAME in your current location.

conda activate NAME

activate environment NAME

conda install PKG

install package PKG into the current environment

conda install -c CHANNEL PKG

install package PKG from channel CHANNEL into the current environment

conda list

show packages in current environment

conda list -n NAME

show packages in environment NAME

conda deactivate

deactivate current environment

Installing Python Packages

...

  • Python packages: All Python packages that will be needed in programs using a package will need to be installed into the same environment, as the instance of Python from this environment will be used to run the programs. To install additional packages, activate the environment, install the packages (with conda if possible, otherwise with pip), then deactivate the environment.

  • Installing PyPi packages with pip: If an attempt to install a package gives an error about trying to write to a location to which there isn't permission, this is usually a result of a PATH issue.

    • It is important to use the instance of pip that was installed in the conda environment, and not one from another location that may be available in the path.

    • The current path can be seen by running 'echo $PATH'.

    • Issues with incorrect directories being included, or occurring in the wrong order, in a path can usually be resolved by logging out and back in, loading Miniconda, then activating the necessary environment.

  • Conda environment dependencies:

    Within the Conda documentation on Managing environments, specifically the section on Building identical conda environments, it states:

    • You can use explicit specification files to build an identical conda environment on the same operating system platform, either on the same machine or on a different machine.

    • An explicit spec file is not usually cross platform, and therefore has a comment at the top such as # platform: osx-64 showing the platform where it was created. This platform is the one where this spec file is known to work. On other platforms, the packages specified might not be available or dependencies might be missing for some of the key packages already in the spec.

    • Conda does not check architecture or dependencies when installing from a spec file. To ensure that the packages work correctly, make sure that the file was created from a working environment, and use it on the same architecture, operating system, and platform, such as linux-64 or osx-64.

    The Miniconda documentation states:
    • System requirements License:

      • Operating system: Windows 8 or newer, 64-bit macOS 10.13+, or Linux, including Ubuntu, RedHat, CentOS 7+, and others.

Common Error Messages

Error: /lib64/libk5crypto.so.3: undefined symbol: EVP_KDF_ctrl, version OPENSSL_1_1_1b

This error is typically associated when trying to use git after performing a module load miniconda3/<version>. For example:

Code Block
[jcook27@wilog01 multiqc]$ git clone https://github.com/ewels/MultiQC_TestData
Cloning into 'MultiQC_TestData'...
/usr/libexec/git-core/git-remote-https: symbol lookup error: /lib64/libk5crypto.so.3: undefined symbol: EVP_KDF_ctrl, version OPENSSL_1_1_1b

This is a know system issue as suggested here https://bugzilla.redhat.com/show_bug.cgi?id=1829790

This appears to be a bug related to conda and Red Hat.

Solution: Exiting the session and logging back in should restore functionality and relates to trying to use a newer version of openssl than installed on the base system.

There are a number of potentially solutions depending on what your use case is:

  1. Use a newer version of git than provided by the base system. Perform a module spider git to see available versions and load.

  2. If you’re using an active conda environment, then you can explicitly install conda into it via conda install -c anaconda git.

Error: json.decoder.JSONDecodeError: Expecting value: line

This may occur while trying to install packages, or creating a new environment.
Solution: Try conda clean -i in your account then re-perform the conda install step.
The clean command removes unused packages and caches, with the -i option removing the index cache that might have become corrupted..

...