This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
conda [2020/07/17 08:32] – [Solutions to these pitfalls] jansen | conda [2025/01/27 15:47] (current) – [Disk usage] jansen | ||
---|---|---|---|
Line 7: | Line 7: | ||
===== Installing Anaconda ===== | ===== Installing Anaconda ===== | ||
- | ==== Method 1: Download and install ==== | + | ==== Method 1: Use the provided version ==== |
+ | All our desktops and compute nodes currently have conda pre-installed, | ||
+ | |||
+ | ==== Method 2: Download and install ==== | ||
You can install anaconda or Miniconda (see anaconda website). This downloads a shell script you can run (either chmod 755 to make it executable, or run 'bash Miniconda3-latest-Linux-x86_64.sh' | You can install anaconda or Miniconda (see anaconda website). This downloads a shell script you can run (either chmod 755 to make it executable, or run 'bash Miniconda3-latest-Linux-x86_64.sh' | ||
Choose the location where you want to install the distribution (in a directory you own, but if you plan to install a lot of software, you should probably not install it in your home directory). | Choose the location where you want to install the distribution (in a directory you own, but if you plan to install a lot of software, you should probably not install it in your home directory). | ||
- | ==== Method | + | ==== Method |
We have pre-installed versions of Miniconda available through EasyBuild. Run | We have pre-installed versions of Miniconda available through EasyBuild. Run | ||
Line 18: | Line 21: | ||
===== Setup ===== | ===== Setup ===== | ||
- | Now that you have the '' | + | Now that you have the '' |
+ | One bit of setup that '' | ||
+ | |||
+ | Note that with the system default version of conda, this init step is not necessary! | ||
+ | |||
+ | Other bits of setup can be done through the '' | ||
===== Creating an environment ===== | ===== Creating an environment ===== | ||
+ | One conda install can manage several environments, | ||
+ | To create an environment called '' | ||
+ | |||
+ | conda create --name TEST | ||
+ | | ||
+ | You can add package names and versions to add some packages immediately to the newly created environment, | ||
+ | conda create --name TEST python==3.6 | ||
+ | | ||
+ | For more information, | ||
+ | |||
+ | Once created, you activate the environment using '' | ||
===== Installing packages ===== | ===== Installing packages ===== | ||
+ | Install a package using '' | ||
+ | |||
+ | If unsure what packages are available, use '' | ||
===== Pitfalls ===== | ===== Pitfalls ===== | ||
+ | ==== Interference with system python environments ==== | ||
As you can see above, the default behaviour when installing conda or running '' | As you can see above, the default behaviour when installing conda or running '' | ||
+ | |||
==== Solutions to these pitfalls ==== | ==== Solutions to these pitfalls ==== | ||
Line 36: | Line 60: | ||
+ | ==== Disk usage ==== | ||
+ | Conda environments can be big. No wonder, since they can contain a full python install, libraries, compilers and many other tools. And as with most programs, conda defaults to store all of this in your $HOME since that is the one place that is known to exist on any UNIX system. | ||
+ | So, you will want to change this location to something with more space, e.g. a local ''/ | ||
+ | This can be done in '' | ||
+ | auto_activate_base: | ||
+ | envs_dirs: | ||
+ | - / | ||
+ | pkgs_dirs: | ||
+ | - / | ||
+ | |||
+ | Additional tip: having the environments locally on your workstation has advantages and disadvantages. One advantage is, that with the same setup, you can have a different instance of an environment on another machine, which is convenient if that other machine is not running the same Linux version as your desktop (eg compute nodes and vdesk). | ||
+ | Disadvantage: | ||
+ | |||
+ | If you are making this change when you already have some conda environments (in $HOME/ | ||
+ | mv .conda / | ||
+ | ln -s / | ||
+ | |