Table of Contents

JYP steps for installing Miniconda3

Before installing Python on a shared computer

Desperately seeking a specific package

Check if the Python package you are desperately seeking is not already installed, before installing your own Python on shared Linux servers, or on a shared cluster !!

Using a specific Python on a jupyter server

If there is a jupyter notebook server connected to your system, but the Python you want to use is not available on the server, follow the using a non-standard kernel instructions, rather than starting your own local server

Why should you use Miniconda3 ?

Downloading Miniconda3, and BASIC installation

Miniconda3 on a Windows computer

Some of the steps below are adapted from the Windows section of "Quick command line install" to install a pure Windows version of Miniconda3

Downloading the Miniconda3 installer on Windows

BASIC Miniconda3 installation on Windows

Miniconda3 on a Linux-like computer

By Linux-like, we mean:

  • A Linux desktop/laptop
    • The installation will be used by one person
  • A Linux server
    • The installation will be used by one or more persons
  • A windows computer with WSL+Ubuntu installed
    • You should use the Windows installer, if all the packages you need are available for Windows
    • The installation will be used by one person
  • A Mac where you can use Linux in a terminal
    • The installation will be used by one person

Downloading the Miniconda3 installer

Using the Miniconda3 installer

We assume below that we are in the directory where we have downloaded the installer

Fine-tuning conda to use (only) conda-forge

Changing the .condarc file

The following steps will make sure that we only get packages from conda-forge (same thing as using the -c conda-forge option) by default unless the requested packages really don't exist on conda-forge. More details in Managing channels

$ cat ~/.condarc
cat: /home/jypmce/.condarc: No such file or directory

$ conda config --get channels

$ conda config --prepend channels conda-forge

$ conda config --set channel_priority strict

$ conda config --get channels
--add channels 'defaults'   # lowest priority
--add channels 'conda-forge'   # highest priority

$ cat ~/.condarc
channels:
  - conda-forge
  - defaults
channel_priority: strict

Getting conda configuration information

Updating (Mini)conda

We have to completely update Miniconda3 at least once after installing Miniconda3 and making conda-forge the highest priority channel

Initializing conda in terminals

Reminder: if you have installed Miniconda3 on a Windows computer, you only have to open a terminal with

  • Start menu ⇒ Anaconda Powershell Prompt
  • conda activate the_environment_you_want

When you open a terminal, your shell needs to know where to find the conda command used to initialize an environment, or switch between existing environments. This can be configured in the shell configuration files

Single-user installation

You were asked the following question when installing Miniconda3: Do you wish to update your shell profile to automatically initialize conda? [yes|no]

We choose not to directly add a conda activate env_name line to the shell configuration files. This would permanently initialize env_name and may cause future (and obscure) side effects.

When we open a new terminal, we get the default Python available on the system. If we need a specific Python environment, we just open a new window and then explicitly type conda activate env_name or the pynit alias defined above

Multi-user installation

In the case of python environments maintained by a single user, but used by several users, we could do the same as in the General case, but it can be useful to have the users source an intermediate initialization file, that will then source the initialization file used in the general case. This makes it easier to maintain and change the environments, without asking users to make changes.

Keeping Miniconda3 up-to-date

conda resources

Web sites

Useful conda commands

This is just a subset of some of the commands, and a subset of their options! For a complete reference, use the official conda website

conda, pip and virtualenv

Installation history

You can get the current list of installed packages with conda list -n existing_environment, but it may also be useful to know in which order the packages were installed:

Uninstalling Miniconda3

Windows computer

Miniconda3 can be removed like a regular Windows application

Linux-like computer

FIXME





[ PMIP3 Wiki Home ] - [ Help! ] - [ Wiki syntax ]