成都网站快照优化公司,微信网站是多少钱一年,网络公司开发软件的人是叫it,怎样建设免费网站Jupyter Notebook 在本地进行访问时比较简单#xff0c;直接在cmd命令行下输入 jupyter notebook 即可#xff0c;然而notebook的作用不止于此#xff0c;还可以用于远程连接服务器#xff0c;这样如果你有一台服务器内存很大#xff0c;但是呢你又不喜欢在linux上进行操作…Jupyter Notebook 在本地进行访问时比较简单直接在cmd命令行下输入 jupyter notebook 即可然而notebook的作用不止于此还可以用于远程连接服务器这样如果你有一台服务器内存很大但是呢你又不喜欢在linux上进行操作、编辑代码时你就可以在本地windows上使用notebook远程到服务器上在本地写代码使用服务器上的资源。
一 安装 Jypute
最开始的时候Jupyter指的就是Jupyter Notebook后来Jupyter公司出了Jupyter Lab。
pip install notebook jupyterlab二 设置密码
2.1 自动设置
$ jupyter server password
Enter password: ****
Verify password: ****
[JupyterPasswordApp] Wrote hashed password to /Users/you/.jupyter/jupyter_server_config.json自动设置不需要再配置文件中配置密码 参考链接automatic-password-setup
2.2 手动设置
打开python输入以下语句
from jupyter_server.auth import passwd
passwd()
Enter password:
Verify password:
sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed手动设置需要在配置文件中配置密码 如果设置了自动密码手动密码就不生效了。 参考链接preparing-a-hashed-password
三 生成配置文件
[rootlocalhost ~]# jupyter server --generate-config
Writing default config to: /root/.jupyter/jupyter_server_config.py四 修改配置文件
打开 jupyter_notebook_config.py, 修改里面的
c.ServerApp.allow_remote_access True
c.ServerApp.allow_root True
# 开启远程访问ip
c.ServerApp.ip *
c.ServerApp.open_browser False
c.ServerApp.password_required True
# 使用自动设置密码则此处不需要配置手动密码
c.ServerApp.password
# 设置端口号
c.ServerApp.port 9999
# notebook存储目录
c.ServerApp.notebook_dir /root/app/jupyter五 启动Jupyter
在命令行输入 jupyter notebook就可以开启服务了。但我们一般希望Jupyter Notebook在后台运行所以可以输入以下命令
# nohup jupyter notebook --allow-root /dev/null 21 启动juypterlab:
# nohup jupyter lab --allow-root /dev/null 21 因为 jupyterlab中包含jupyter notebook, 所以启动jupyterlab则同时也启动了jupyter notebook.