Using Jupyter Gracefully~

You may get your Jupyter deployed easily via conda environment,but there are multifarious commands and extensions to enhance prolificacy we barely know .We are working to integration useful Jupyter skills to make Jupyter usage gracefully.
Although it still need to be perfected,we assume that Jupyter lab will replace notebook soon. Following application are Jupyter lab working environment based,however,most of them can also used in Jupyter notebook. Modified 20-02-04

Arguments

  • jupyter lab
    • --allow-root: Allow the notebook to be run from root user.
    • --no-browser: Don't open the notebook in a browser after startup.

R installation (base on conda)

conda install R
R
>install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))
>devtools::install_github('IRkernel/IRkernel')
>IRkernel::installspec()

Tips

  • If there is library dependency problem occur while R packages installing, most of them can be sloved by install packags like devtools via conda commands, like : conda install -c r r-devtools . Packages infromation can be serached in https://anaconda.org/
  • Sometims when you finished R kernel installtion, but jupyter kernel collapse all the times. Use sudo apt-get install x11vnc to overcome failed to load cairo DLL problem on Ubuntu.

Julia installation

#Julia mirror ,ZJU
https://mirrors.zju.edu.cn/julia/releases/
#Aug4,19 installed;choose your own suitable version 
wget https://mirrors.zju.edu.cn/julia/releases/v1.2/julia-1.2.0-rc3-linux-x86_64.tar.gz
tar -xvzf julia-1.2.0-rc3-linux-x86_64.tar.gz
./julia-1.2.0-rc3/bin/julia
julia > import Pkg
julia > Pkg.add("IJulia")

C installation

pip3 install jupyter-c-kernel
install_c_kernel

Deploy Jupyter on server with no permission to use web service ports

  1. Dependencies: get jupyter notebook/lab installed
  2. Activate locally Jupyter service
    nohup .../jupyter notebook --notebook-dir <PATH> --port <server_port> --no-browser &
  3. Construct SSH tunnel to server (execute following command on your own terminal)
    ssh -L <local_port>:localhost:<server_port> user@address
    This process needs to keep running in the background
  4. Use local browser to access localhost:<server_port>
    If your server has it's own public IP ,you can skip step 3 and access your workplace directly via browser,with address :ip:port

Setup password for your jupyter

jupyter notebook password

Overcome plotly rendering problem

--NotebookApp.iopub_data_rate_limit=1.0e1
Does not work in jupyter lab.

Manage currently-running Jupyter

View all Jupyter current user started:jupyter notebook list
Kill specific notebook : fuser -k '8999(port)'/tcp

Clone server-side files via jupyer cell lines

Oss2 provide a convenient python SDK to manipulate oss bucket, we can utilize oss2 to backup server-side files.

  • install oss2 ! pip install oss2
  • cell running following command to upload file to your oss bucket
import oss2
auth = oss2.Auth('<yourAccessKeyId>', '<yourAccessKeySecret>')
bucket = oss2.Bucket(auth, '<BucketEndPoint>', '<yourBucketName>')
bucket.put_object_from_file('<yourObjectName>', 'content of object' )

Far more oss bucket & NAS artifice will be updated separately.
Make sure you could be responsible for compliance with your own behavior.

[1] https://jupyterlab.readthedocs.io/en/latest/
[2] manipulate oss bucket via python SDK

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容