服务器搭建Jupyter Notebook - 实现web端运行py程序
目的是在阿里云搭建Jupyter Notebook,实现远程web运行py文件
使用方法:https://blog.csdn.net/Lee_J_R/article/details/52791228
1、ubuntu18 端:
主要参考 https://blog.csdn.net/web_9705/article/details/80421044
-
1.1. 安装jupyter
pip3 install jupyter
-
1.2. 创建
config.py
-
- 云服务器上布置jupyter,
jupyter notebook --generate-config
- 云服务器上布置jupyter,
-
- 安装jupyter notebook 后,直接从,配置jupyter notebook开始
-
1.3. 配置
config.py
# 2019-8-7 10:50:27
c.NotebookApp.ip = '*'
c.NotebookApp.port = 6060
c.NotebookApp.notebook_dir = '/root/workspace/jupyterNotebook'
# c.NotebookApp.notebook_dir = 'E:\workspace\python\jupyterNotebook'
c.NotebookApp.open_browser = False
c.NotebookApp.password = 'sha1:3337b91d8a61:2444680864ef5d5c08d868bd0ef149c9ed160fce'
-
1.4. 开放入网规则
-
1.5. 开放防火墙端口
-
- 开放防火墙端口, https://blog.csdn.net/justheretobe/article/details/51843178
ufw allow 6060
- 开放防火墙端口, https://blog.csdn.net/justheretobe/article/details/51843178
-
1.6. 启动服务器
jupyter notebook
-
1.7. 配置成自启动
-
- 开放防火墙端口, https://zhuanlan.zhihu.com/p/43542649
ufw allow 6060
,
|
|
- 开放防火墙端口, https://zhuanlan.zhihu.com/p/43542649
我自己的 jupyter_notebook_config.py
主要配置
# 2019-8-7 10:50:27
c.NotebookApp.ip = '*'
c.NotebookApp.port = 6060
c.NotebookApp.notebook_dir = '/root/workspace/jupyterNotebook'
# c.NotebookApp.notebook_dir = 'E:\workspace\python\jupyterNotebook'
c.NotebookApp.open_browser = False
c.NotebookApp.password = 'sha1:3337b91d8a61:2444680864ef5d5c08d868bd0ef149c9ed160fce'
windows端安装与使用
- 手动启动;
jupyter notebook
- 脚本启动 ,保存下面2行为
jupyterNotebook.bat
文件,双击即可运行后,浏览器打开 http://localhost:6060
@echo off
jupyter notebook
-
开启自启动
将第2步的脚本,放在C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\
下 -
配置成服务启动
–待实现,吃午饭去