85 lines
2.6 KiB
Markdown
85 lines
2.6 KiB
Markdown
# Conda / Anaconda
|
|
|
|
Conda / Anaconda (https://conda.org) is a package manager that can be used to easily create tailored Python environments without having required C/... binaries of some packages installed on the local system. (i.e. conda will take care that required binaries are installed into the environment)
|
|
|
|
```{warning}
|
|
Due to certain license restrictions the usage of Anaconda at PSI is not allowed without obtaining a professional license from Anaconda.com!
|
|
|
|
However the usage of the command `conda` and/or of packages from conda-forge is still possible - see below ...
|
|
```
|
|
|
|
This guide explains how to install and configure conda in accordance to the Anaconda.com license terms.
|
|
|
|
|
|
## Installation
|
|
On a standard Linux system the conda package can be simply installed via a:
|
|
|
|
```
|
|
yum install conda
|
|
```
|
|
|
|
To instruct puppet to install the package you can have following hiera config:
|
|
|
|
```yaml
|
|
base::pkg_group::extra:
|
|
- 'conda'
|
|
|
|
base::package_groups:
|
|
- 'extra'
|
|
```
|
|
|
|
## Configuration
|
|
|
|
To overwrite the default configuration of conda (which would violate the license because packages would be installed from anaconda.org by default) following config file needs to be deployed in `/etc/conda/condarc.d/base.yml` (or similar):
|
|
|
|
```yaml
|
|
channels:
|
|
- conda-forge
|
|
- nodefaults
|
|
|
|
# Show channel URLs when displaying what is going to be downloaded
|
|
# and in 'conda list'. The default is False.
|
|
show_channel_urls: True
|
|
always_copy: true
|
|
```
|
|
|
|
To place the file via Puppet/Hiera you can have following configuration:
|
|
|
|
```yaml
|
|
files::files:
|
|
/etc/conda/condarc.d/base.yml:
|
|
content: |
|
|
channels:
|
|
- conda-forge
|
|
- nodefaults
|
|
|
|
# Show channel URLs when displaying what is going to be downloaded
|
|
# and in 'conda list'. The default is False.
|
|
show_channel_urls: True
|
|
always_copy: true
|
|
```
|
|
|
|
|
|
To be able to use the `conda` command a user needs to source the command into its current shell. This can be done like this:
|
|
|
|
```bash
|
|
source /opt/conda/etc/profile.d/conda.sh
|
|
```
|
|
|
|
|
|
Afterwards conda environments can be created in a license conformed way as documented at https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
|
|
|
|
|
|
## Usage
|
|
|
|
More details on the usage of the `conda` command can be found here:
|
|
https://docs.conda.io/projects/conda/en/stable/user-guide/index.html
|
|
|
|
|
|
### Important Info
|
|
It seems that the `conda list <package>` command still uses the default channel. However `conda install` seem to respect the config above.
|
|
|
|
Probably related to this here:
|
|
https://stackoverflow.com/questions/67695893/how-do-i-completely-purge-and-disable-the-default-channel-in-anaconda-and-switch
|
|
|