Install Anaconda3 on WSL2 of windows10 and build the execution environment of Jupyter Lab. This article describes running Ubuntu 20.04 LTS version on WSL2. At the time of writing, the version of Anaconda 3 was Anaconda 3-2020.07.
There are many other easy-to-understand and detailed articles, so I won't cover them in this article. Please prepare yourself.
Reference URL -Installation Guide for Windows Subsystem for Linux for Windows 10 -Installation of WSL 2, installation and use of Ubuntu 20.04, 18.04
Here are the steps to install Anaconda 3 on WSL2. Any terminal can be used to operate WSL2, but Windows Terminal is quite cool, so we recommend using this. Reference URL ・ What is Windows Terminal
First, go to the Anaconda installer distribution page and check for the latest version.
Access the following URL.
Anaconda Download Page
Right-click on Linux 64-Bit (x86) Installer
here and press Copy Link Address
to save the URL.
From here, use the installer to install Anaconda3 in the WSL2 environment. Operate with Windows Terminal etc.
Download installer First, let's create a working folder.
$ cd ~
$ mkdir tmp;cd tmp
Now download the installer with wget [URL you copied earlier]
.
$ wget https://repo.continuum.io/archive/Anaconda3-2020.07-Linux-x86_64.sh
It will take some time to download, so please wait for a while.
Run the installer.
$ bash Anaconda3-2020.07-Linux-x86_64.sh
From here, it is the setting for environment construction. Basically, there is no problem if you follow the instructions on the screen. From now on, [ENTER] indicates to press the enter button.
Welcome to Anaconda3 2020.07
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>> [ENTER]
===================================
End User License Agreement - Anaconda Individual Edition
===================================
Copyright 2015-2020, Anaconda, Inc.
All rights reserved under the 3-clause BSD License:
...
Since this is the license part, I will skip it appropriately. ...
You will be asked if you want to accept the license, so type yes
.
Do you accept the license terms? [yes|no]
[no] >>> yes
You will be asked for the directory where you want to install Anaconda3. Since the area directly under the user directory is specified, press enter if there is no problem. (If you want to install it anywhere, follow the instructions on the screen)
**** indicates the user name.
Anaconda3 will now be installed into this location: /home/****/anaconda3
[/home/****/anaconda3] >>> [ENTER]
The package will be unpacked. Let's wait for a while.
Type yes
when asked the following questions:
Do you wish the installer to initialize Anaconda3
by running conda init? [yes|no]
[no] >>> yes
Finally, make sure that Anaconda 3 is installed.
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 Anaconda3!
...
The following display is omitted because there is no particular problem. ...
As it is, the path is not added, so you cannot use conda or jupyter lab. So add the path next.
$ echo "export PATH=~/anaconda3/bin:\$PATH" >> ~/.bashrc
$ source ~/.bashrc
To confirm that the path has been added, check the version of the conda command. At the time of writing this article, the version was 4.8.3.
$ conda -V
conda 4.8.3
Finally, start Jupyter Lab. You won't need an authentication token as it runs in a local development environment.
$ jupyter lab --NotebookApp.token=''
Access the URL from your browser URL: http://localhost:8888/
If you can run jupyter lab like this, there is no problem.
After that, let's enjoy development by writing code and setting up Jupyter Lab.
Recommended Posts