Here in this tutorial, we will learn the steps to install open source Anaconda Navigator on WSL – Windows Subsystem for Linux – Windows 10 using Ubuntu 20.04 / 18.04 Linux application.
Although Anaconda Navigator is by default available for Windows 10 in the executable file format. However, if you still want to install it on the Linux interface that runs on Linux WSL 1 or WSL 2 applications such as Ubuntu, that is also possible.
If you want to learn more about the Anaconda, this is essential software that was developed for use with Python and other science packages and their dependencies, such as conda. It supports Linux, Mac, and Windows systems and can easily resolve coexistence, switching, and various third-party packages of multiple versions of Python.
Installing Anaconda is pretty straightforward and those who don’t want to use the command line interface to install packages, various dependencies, and create an environment also offer the graphical user interface called Anaconda Navigator …
Once Anaconda is installed, python, conda, numpy, scipy, pandas, and other common scientific computing packages that can be used in general are installed, without the need to download the configuration separately. Due to the separation of python3 and python2, using virtualenv to configure with pip is often very convenient.
Those who are familiar with how Linux works are already familiar with the process of installing Anaconda on WSL 1 or 2, however, the main thing is how to access its graphical user interface, i.e. Navigator. And that you will find out here.
1. Activate WSL and install the Ubuntu application
Those new to WSL – Windows 10 Subsystem for Linux should know that the Ubuntu Linux app that we download from the Microsoft store will not work until the WSL feature is enabled on the system. Therefore, I am assuming that you have already activated and downloaded the WSL with the Linux application to run it. However, if not, follow this tutorial: How to Enable Windows Subsystem Feature for Linux.
2. Open the Linux Ubuntu application
Now go to the search box and type Ubuntu. Select version 20.04 or 18.04, whichever is available on your Windows 10 for use with WSL.
3. Update and upgrade the WSL application
Before we go any further, let’s make sure that the packages already existing on the Linux system are up to date and in their latest state. To do this simply run:
sudo apt update
sudo apt upgrade
Open the browser of your Windows 10 system and go to the official Anaconda website to download it, here is the link for the same. Scroll down, right click on the Linux 64-bit (x86) installer and copy its link.
After that go back to the Ubuntu WSL app, type
wget and paste the link, for example:
wget get https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh
Wait a while until it is not completely downloaded to your system. The script size will be around 550MB, so it would take a while depending on the internet connection you have.
5. Run the installation script
Now we have the Anaconda installation script, let’s run to trigger the installation process. type
You will see the downloaded file.
./ with file name
For example, the name of the file we downloaded in this tutorial is Anaconda3-2020.07-Linux-x86_64.sh, the installation command will therefore be:
bash Anaconda*-*-Linux-x86_64.sh or ./Anaconda*-*-Linux-x86_64.sh
6. Accept the terms of the license
The installer will be activated and ask you to press the button Enter key to start the process. When the license term appears, read it using the Enter or just skip the same by just pressing the ‘keyq ‘ keyboard key.
After this kind Yes to accept the terms and conditions.
7. Select the installation directory
By default, Anaconda Navigator on Linux will create the installation folder under the system home directory. So you can let it use the same. However, if you want to use another location on the system, assign that path to it and then press the Return key.
Wait a few minutes until the process of setting up Anaconda Navigator on WSL Ubuntu is not complete. Once done, go to the next step.
8. Reload the shell
Instead of closing the Ubuntu WSL application to make sure the installation will go smoothly, just reload the shell. For that:
9. Start using Anaconda on WSL Ubuntu
You can now start using the command line interface to create the Anaconda environment with different packages for different projects without interfering with each other. Well, those who would like to have the graphical user interface take the next step.
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-h2s' qt.qpa.screen: QXcbConnection: Could not connect to display Coulld not connect to any X display.
As we know by default, the WSL will not allow you to open graphical applications directly on the shell screen by default. However, there is another way to do it.
Go to MobaXterm and download it. This is a lightweight software that comes with various built-in tools to access SSH, VNC, SFTP, Command Terminal, etc. servers.
- Open the MobaXterm, once you have it on your system.
- Click on the Session option given in the Menu of his.
- To select WSL available at the end of the tools menu.
- Of Basic WSL setting, click on the Scrolling menu box and select Ubuntu and press the Okay button.
- Now you will see your Ubuntu WSL application on MobaXterm, great.
- There, just type:
- That’s it, this will open the Anaconda GUI running on Windows 10’s Ubuntu WSL app.
- Start building environments and installing different packages right from the Navigator GUI.