Rock It 《ML》JupyterLab 【甲】動土破甲

如何在 ROCK64 Armbian 裡,打造最新的 JupyterLab 呢?

Overview

JupyterLab is the next-generation web-based user interface for Project Jupyter.

JupyterLab enables you to work with documents and activities such as Jupyter notebooks, text editors, terminals, and custom components in a flexible, integrated, and extensible manner. You can arrange multiple documents and activities side by side in the work area using tabs and splitters. Documents and activities integrate with each other, enabling new workflows for interactive computing, for example:

  • Code Consoles provide transient scratchpads for running code interactively, with full support for rich output. A code console can be linked to a notebook kernel as a computation log from the notebook, for example.
  • Kernel-backed documents enable code in any text file (Markdown, Python, R, LaTeX, etc.) to be run interactively in any Jupyter kernel.
  • Notebook cell outputs can be mirrored into their own tab, side by side with the notebook, enabling simple dashboards with interactive controls backed by a kernel.
  • Multiple views of documents with different editors or viewers enable live editing of documents reflected in other viewers. For example, it is easy to have live preview of Markdown, Delimiter-separated Values, or Vega/Vega-Lite documents.

JupyterLab also offers a unified model for viewing and handling data formats. JupyterLab understands many file formats (images, CSV, JSON, Markdown, PDF, Vega, Vega-Lite, etc.) and can also display rich kernel output in these formats. See File and Output Formats for more information.

To navigate the user interface, JupyterLab offers customizable keyboard shortcuts and the ability to use key maps from vim, emacs, and Sublime Text in the text editor.

JupyterLab extensions can customize or enhance any part of JupyterLab, including new themes, file editors, and custom components.

JupyterLab is served from the same server and uses the same notebook document format as the classic Jupyter Notebook.

 

幾經嘗試失敗,糾結於派生三程式庫『版本』問題!

發現了一個『巧門』︰最好少用系統提供的 Python3 套件?!

sudo apt-get install python-pip python3-dev python3-setuptools
sudo apt-get install python3-ipython

 

盡量以 pip3 安裝也!?

sudo pip3 install jupyter
sudo pip3 install jupyterlab

 

注意過程中是否提示

sudo pip not uninstalling … outside environment /usr

訊息,若有得用 sudo apt-get remove 移除呦!!

sudo apt-get remove python3-prompt-toolkit

 

然後再安裝 scipy 科學計算 □ ○ 軟件

sudo pip3 install numpy scipy matplotlib pandas scikit-learn

大體 OK 矣☺

 

不過如果想要『擴張』

Extensions

Fundamentally, JupyterLab is designed as an extensible environment. JupyterLab extensions can customize or enhance any part of JupyterLab. They can provide new themes, file viewers and editors, or renderers for rich outputs in notebooks. Extensions can add items to the menu or command palette, keyboard shortcuts, or settings in the settings system. Extensions can provide an API for other extensions to use and can depend on other extensions. In fact, the whole of JupyterLab itself is simply a collection of extensions that are no more powerful or privileged than any custom extension.

JupyterLab extensions are npm packages (the standard package format in Javascript development). There are many community-developed extensions being built on GitHub. You can search for the GitHub topic jupyterlab-extension to find extensions. For information about developing extensions, see the developer documentation.

 

『實驗室』環境,沒有 nodejs 、 npm 則不行哩☻

只能去舊步新乎★

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash –
sudo apt-get install -y nodejs

rock64@rock64:~node -v v10.15.1 </pre> <pre class="lang:default decode:true ">rock64@rock64:~ npm -v
6.4.1

 

接著開工耶☆

rock64@rock64:~$ jupyter-lab
[I 15:27:57.582 LabApp] JupyterLab extension loaded from /usr/local/lib/python3.5/dist-packages/jupyterlab
[I 15:27:57.583 LabApp] JupyterLab application directory is /usr/local/share/jupyter/lab
[W 15:27:57.597 LabApp] JupyterLab server extension not enabled, manually loading...
[I 15:27:57.615 LabApp] JupyterLab extension loaded from /usr/local/lib/python3.5/dist-packages/jupyterlab
[I 15:27:57.615 LabApp] JupyterLab application directory is /usr/local/share/jupyter/lab
[I 15:27:57.620 LabApp] Serving notebooks from local directory: /home/rock64
[I 15:27:57.620 LabApp] The Jupyter Notebook is running at:
[I 15:27:57.621 LabApp] http://localhost:8888/?token=ca029183fc2fb9755eee94d517b200445e1ccaa9ce31de4e
[I 15:27:57.622 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 15:27:57.647 LabApp] 
    
    To access the notebook, open this file in a browser:
        file:///run/user/1000/jupyter/nbserver-18043-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=ca029183fc2fb9755eee94d517b200445e1ccaa9ce31de4e
...