[PYTHON] Jupyter Lab begins

Introduction

Jupyter will be greatly improved in UI and functions as ** Jupyter Lab ** from the next version. Here, I will back the leaflet for myself how to build the Jupyter Lab environment on AWS EC2 and how to use it easily. Aside from the detailed settings, the goal is to quickly build a Jupyter Lab environment on EC2 and try out how it has evolved.

Jupyter Lab is still a preview version, please refer to Jupyter Lab Github for the latest information. Also, for the environment construction method of the old Jupyter Notebook, please refer to Click here.

** Overview of Jupyter Lab features **

For the background and function introduction of Jupyter Lab development, see Jupyter Lab introduction video and [Explanation Slide](http: /) at SciPy 2016. /archive.ipython.org/media/SciPy2016JupyterLab.pdf) is easy to understand, but the following two materials are the key points.

hadoop1.png hadoop2.png

Jupyter Lab environment construction procedure

This is the procedure to build a Jupyter Lab environment on AWS EC2. It is almost the same as the environment construction method of the old Jupyter Notebook.

Creating EC2

Start EC2 that runs Jupyter and log in with ssh.

Install required modules

ʻAtp-get` to put the required module, update pip and install jupyterlab.

$ sudo apt-get update && sudo apt-get -y upgrade
$ sudo apt-get install -y python-pip libpq-dev python-dev
$ sudo pip install -U pip
$ sudo pip install jupyterlab widgetsnbextension
$ sudo jupyter serverextension enable --py jupyterlab --sys-prefix

If you want to write a Chart with Matplotlib, add the necessary modules such as numpy and matplotlib (but it will take a few minutes to install).

$ sudo apt-get install -y libpng12-dev libjpeg8-dev libfreetype6-dev libxft-dev
$ sudo pip install numpy pandas matplotlib seaborn scikit-learn

Jupyter Lab Preferences

The following command will create a Jupyter configuration file template (~ / .jupyter / jupyter_notebook_config.py).

$ jupyter notebook --generate-config

Then edit ~ / .jupyter / jupyter_notebook_config.py. Since it is a big file that is all commented out, put the following 4 lines in any place you like, such as the beginning of the file, and save it.

c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8080

Launch Jupyter Lab

Run the following command to start Jupyter.

$ jupyter lab

In this state, go to EC2 such as ʻec2-53-239-93-85.ap-northeast-1.compute.amazonaws.com:8080on the browser and succeed if the following Jupyter Lab initial screen appears. (Don't forget the port8080`).

jupyterlab.jpg

If you want to run Background, set nohup jupyter lab> / dev / null 2> & 1 & and Jupyter will continue to work even if you disconnect ssh.

Jupyter autostart settings

If you want to start Jupyter lab automatically, you can make it run jupyter lab when AWS EC2 starts by following the steps below.

Finally

Have a good Jupyter life!

Recommended Posts

Jupyter Lab begins
Jupyter begins
Install Python Jupyter lab
Make Jupyter Lab accessible remotely
Label images on jupyter lab
Error: 500 (Internal Server Error) Jupyter lab
Run Open Modelica from Jupyter Lab
Tkinter begins
Memory leak in Python Jupyter Lab (Notebook)?
Build Jupyter Lab (Python) environment with Docker
Jupyter Tips 4
Jupyter nbextensions
Poetry begins
Use Jupyter Lab and Jupyter Notebook with EC2
Jupyter Tips 5
PyCharm begins
Jupyter Tips 3
Jupyter Tips 2
Build the execution environment of Jupyter Lab
Jupyter installation
Jupyter tricks
Let's make jupyter lab easy to use
[Jupyter Notebook / Lab] 3 ways to debug on Jupyter [Pdb]
How to Git from GCP's Jupyter Lab to GSR