Basic use of Synology NAS installation JupyterLab

Original link: https://fugary.com/?p=527

Jupyter is a relatively easy-to-use online tool. It can be used as a Notebook note, and it can execute Python code online. It belongs to an interactive development environment.

By default, Jupyter uses the local folder as the working directory, which is not very convenient. You can consider installing it on NAS , and use the directory in NAS as the working directory, which can realize remote access and modification anytime and anywhere.

Jupter introduction

URL: https://jupyter.org/about

Jupyter project is a non-profit open source project born out of the IPython project in 2014, and as it has grown, it supports interactive data science and scientific computing across all programming languages. Jupyter will always be 100% open source software, free for everyone to use, and released under the liberal terms of the Modified BSD License .

online trial

The official online trial address is provided: https://jupyter.org/try , you can consider trying it out before installing it

There are currently three that can be tried:

image-20230708153752370

  1. JupyterLab – contains Jupyter Notebook and more other tools, it is an integrated environment
  2. Jupyter Notebook ——Compared with the original Jupyter Notebook , it basically only includes basic functions such as notes and running
  3. Voila – display Dashboard , you can convert the ipynb file of notebook into a graphical display

The current official statement is that they are all built based on the JupyterLite project , and JupyterLite is still a third-party project.

The official provides other third-party trials, which can support more languages. It seems that Jupyter ecology is still good, and it supports C++ , etc.

image-20230708160056055

local installation

Installation documentation: https://jupyter.org/install

 # 安装命令pip install jupyterlab # 运行命令(新建自己的notebook目录,在目录下运行) jupyter-lab

After running, the browser will be opened automatically, the address is: http://localhost:8888/lab , the overall function is more than notebook version, so it is recommended to use JupyterLab

notebook installation (not recommended, less functions):

 # 安装pip install notebook # 启动:http://localhost:8888/tree jupyter notebook

Create a new file test:

image-20230708155648524

Test run:

image-20230708155609701

It can be used normally now, but it can only be accessed locally, and the files are also in the local folder. Next, we need to install Jupyter on NAS .

Synology installation

Install JupyterLab in the Synology NAS , you can access our services remotely, and the files are stored on the server (under the /JupyterLab directory), and can be accessed anytime, anywhere

First add [Mine God] Synology in the package center: https://spk7.imnks.com/

image-20230708160654374

Install JupyterLab

After adding, you can search directly:

image-20230708160604372

Click [Install Kit], you can access after installation, the default port is 18885 , address: http://NAS_IP:18885/ You can also click [Open], and then automatically open the web page through [Management].

The port can be modified through [Server Global Configuration], and the password can also be modified here.

image-20230708161530932

Login to JupyterLab

After entering, it is required to log in, which is included in the installation instructions by default, and the password is: QQ316122141

image-20230708162021024

image-20230708161858398.png

login successful.

change Password

After successful login, remember to change the password as soon as possible. At present, it is usually troublesome to change the password:

  1. Generate passwords with jupyter tools
  2. Fill in the global configuration, save

To generate a password, you can open a Console in JupyterLab to execute:

 from jupyter_server.auth import passwd passwd('123456abcdef') # 会得到一串数据:'argon2:$argon2id$v=19$m=10240,t=10,p=8$LGn3UCJFWk8KCC2xw5SdtA$yP9JTWWr8F2tmPDYMwxEj4jMsqmPB9FcefmiBXDQn58'

image-20230708164734948

Copy the returned data, modify the value of c.ServerApp.password , and click [Save].

image-20230708164310982

After the modification, you should be able to log in again, and log in with the new password.

This article is transferred from: https://fugary.com/?p=527
This site is only for collection, and the copyright belongs to the original author.