Install Miniconda and Anaconda on WSL 2 or Linux

Kontext Kontext visibility 30,162 event 2022-06-19 access_time 2 years ago language English

Anaconda and Miniconda are commonly used by Python developers to create Python virtual environments with different Python versions and packages. This article shows you how to install Miniconda or Anaconda on a WSL2 Debian GNU Linux distro. This can be applied to other WSL2 distros or Linux directly with small changes of the command lines. 

This article provides detailed steps of installing Miniconda. The steps are the same for Anaconda installation and the only difference is that the installer packages are different. 


You can install WSL 2 following this article - Install Windows Subsystem for Linux on a Non-System Drive.

Download Miniconda Linux installer

The installer can be downloaded from the official web page: Miniconda — Conda documentation.

For this article, I am downloading this specific version: Miniconda3 Linux 64-bit. This can be done by running the following command in your WSL distro:

sudo apt-get update
sudo apt-get install wget

Validate checksum

SHA256 hash is '78f39f9bae971ec1ae7969f0516017f2413f17796670f7040725dd83fcff5689' provided by the official page.

We can verify using the following command line:

$ sha256sum

The output is consistent with the expected. This is to ensure the binary package is not modified.

Install Miniconda

Now we can install it by running the following command:

sh ./


Press ENTER to continue.

When asked, you need to accept license by type yes to continue:

Do you accept the license terms? [yes|no]
[no] >>>
Please answer 'yes' or 'no':'

And then press ENTER to continue.

Miniconda3 will now be installed into this location:

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/home/kontext/miniconda3] >>>

You can also init Miniconda by typing yes:

Preparing transaction: done
Executing transaction: done
installation finished.
Do you wish the installer to initialize Miniconda3
by running conda init? [yes|no]
[no] >>> yes
no change     /home/kontext/miniconda3/condabin/conda
no change     /home/kontext/miniconda3/bin/conda
no change     /home/kontext/miniconda3/bin/conda-env
no change     /home/kontext/miniconda3/bin/activate
no change     /home/kontext/miniconda3/bin/deactivate
no change     /home/kontext/miniconda3/etc/profile.d/
no change     /home/kontext/miniconda3/etc/fish/conf.d/
no change     /home/kontext/miniconda3/shell/condabin/Conda.psm1
no change     /home/kontext/miniconda3/shell/condabin/conda-hook.ps1
no change     /home/kontext/miniconda3/lib/python3.9/site-packages/xontrib/conda.xsh
no change     /home/kontext/miniconda3/etc/profile.d/conda.csh
modified      /home/kontext/.bashrc

==> For changes to take effect, close and re-open your current shell. <==

If you'd prefer that conda's base environment not be activated on startup,
   set the auto_activate_base parameter to false:

conda config --set auto_activate_base false

Thank you for installing Miniconda3!

Now you can use conda command to manage your Python virtual environments. Refer to page for more information: Create Environments with Different Python Versions in Anaconda.


Miniconda — Conda documentation

More from Kontext
info Last modified by Kontext 2 years ago copyright This page is subject to Site terms.
Like this article?
Share on
comment Comments
No comments yet.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts