#jupyter
Jupyter Notebook是一个交互式笔记本,支持运行 40 多种编程语言。

{
yum install -y python-pip
python -m pip install --upgrade pip
python -m pip install jupyter
#python3 -m pip install --upgrade pip
#python3 -m pip install jupyter

#产生配置文件
jupyter notebook --generate-config
Writing default config to: /root/.jupyter/jupyter_notebook_config.py

#创建密码
from notebook.auth import passwd
passwd("1234")

#修改配置文件
vim ~/.jupyter/jupyter_notebook_config.py
路径:注意路径最后一级后面不要加符号
# The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir = u'/data'
修改访问ip与端口、访问密码

nohup jupyter notebook --allow-root &>>/dev/null &
}

Jupyter Notebook 有两种键盘输入模式。编辑模式,允许你往单元中键入代码或文本;这时的单元框线是绿色的。命令模式,键盘输入运行程序命令;这时的单元框线是灰色。
Shift+Enter : 运行本单元,选中下个单元
Ctrl+Enter : 运行本单元
Alt+Enter : 运行本单元,在其下插入新单元
Y:单元转入代码状态
M:单元转入markdown状态
A :在上方插入新单元
B:在下方插入新单元
X:剪切选中的单元
Shift +V:在上方粘贴单元

2 对 “jupyter”的想法;

  1. location /note {
    #auth_basic “note auth”;
    #auth_basic_user_file auth/htpasswd;
    proxy_pass http://10.0.1.1:8888/tree/note;
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header REMOTE-HOST $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

  2. 在服务器上执行:
    jupyter notebook –generate-config
    记录下生成的配置文件位置,例如:/home/.jupyter/jupyter_notebook_config.py
    打开jupyter,新建一个notebook,生成密码的sha1秘钥,代码如下:
    from notebook.auth import passwd
    passwd()
    在文本框中输入并确认一次密码后记录sha1秘钥值,如 ‘sha1:XXXXXXX’
    将这段值按如下格式粘贴到配置文件jupyter_notebook_config.py末尾
    c.NotebookApp.password = u’sha1:XXXXXXX’
    重启jupyter,重新打开网页即可

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code