Building a Jupyter Lab development environment on WSL2 using Anaconda3

Goal of this article

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.

WSL2 environment construction

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

Jupyter Lab construction procedure in WSL2

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

Anaconda3 version check

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.

image.png

Run the installer

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)

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

Running Jupyter Lab

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. image.png

After that, let's enjoy development by writing code and setting up Jupyter Lab.

Recommended Posts

Building a Jupyter Lab development environment on WSL2 using Anaconda3
Building a Python environment on a Mac and using Jupyter lab
Until building a Python development environment using pyenv on Ubuntu 20.04
Building a Python development environment on Windows -From installing Anaconda to linking Atom and Jupyter Notebook-
Build a Django development environment using pyenv-virtualenv on Mac
Create a comfortable Python 3 (Anaconda) development environment on windows
Build a Python development environment using pyenv on MacOS
Building a Python environment on Mac
Building a Python environment on Ubuntu
Building a pyhon environment without using Anaconda (with easy startup)
Building a development environment with Maven on Google App Engine [Java]
Building a virtual environment using homebrew + pyenv-virtualenv
Building a LaTeX environment on Chrome OS
Building a Python development environment for AI development
How to quickly create a machine learning environment using Jupyter Notebook on macOS Sierra with anaconda
Create a Python development environment on Windows (Visual Studio Code remote WSL).
Build Python3.5 + matplotlib environment on Ubuntu 12 using Anaconda
Building a Python environment with WLS2 + Anaconda + PyCharm
Build a Python development environment on your Mac
[Python] Web development preparation (building a virtual environment)
Build a Kubernetes environment for development on Ubuntu
Set up a Python development environment on Marvericks
Building a Python environment on a Sakura VPS server
Create a Python virtual development environment on Windows
Build a Python development environment on Raspberry Pi
Building a Python environment for pyenv, pyenv-virtualenv, Anaconda (Miniconda)
Build a local development environment for Laravel6.X on Mac
Building a training environment for penetration testing using Naumachia
Notes on creating a python development environment on macOS Catalina
Building a TensorFlow environment that uses GPU on Windows 10
Build a GVim-based Python development environment on Windows 10 (1) Installation
Build a Python development environment on Mac OS X
Build a Python environment on your Mac using pyenv
Procedure for building a CDK environment on Windows (Python)
Notes on creating a virtual environment with Anaconda Navigator
Memo for building a machine learning environment using Python
Setting up Jupyter Lab in a Python 3.9 venv environment
Create a Python development environment on OS X Lion
Prepare Django development environment using homebrew on MacOSX Mavericks (10.9)
Build a lightweight Fast API development environment using Docker
Create a Python (pyenv / virtualenv) development environment on Mac (Homebrew)
How to quickly create a machine learning environment using Jupyter Notebook with UbuntuServer 16.04 LTS with anaconda
Anaconda environment construction on CentOS7
Create a VS Code + Docker development environment on a Linux VM
Building a development environment for Android apps-creating Android apps in Python
Build a GVim-based Python development environment on Windows 10 (2) Basic settings
Django environment development on Windows 10
Building a Python virtual environment
Label images on jupyter lab
Build a Flask development environment at low cost using Docker
Building a Python virtual environment
Put Jupyter and Docker Compose on your Chromebook and use it as a light development environment!
Linux environment construction (on WSL environment)
Build a Python environment with WSL + Pyenv + Jupyter + VS Code
Build a Chainer environment using CUDA and cuDNN on a p2 instance
How about Anaconda for building a machine learning environment in Python?
Build a local development environment for Lambda + Python using Serverless Framework
Build a Python environment on your Mac with Anaconda and PyCharm
How to build a Python environment using Virtualenv on Ubuntu 18.04 LTS
I tried to visualize BigQuery data using Jupyter Lab on GCP
Building an environment to run ChainerMN on a GPU instance on AWS