文档章节

jupyter部署安装

mbzhong
 mbzhong
发布于 07/20 22:59
字数 1095
阅读 13
收藏 0

 sudo /usr/bin/python3 -m ipykernel install --name python3.6.8

sudo pip373 install ipykernel

 sudo python373 -m ipykernel install --name python3.7.3
 

python373 -m ipykernel install --name python373
ipython kernelspec list

sc create myjupyterservice binpath="D:\apply\Python373\Scripts\jupyter-notebook --config=V:/my_work/jupyter/config/jupyter_notebook_config.py  --no-browser -y --allow-root" displayname="my jupyter service " start=auto


C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

D:\apply\Python373\Scripts\jupyter-notebook --config=V:/my_work/jupyter/config/jupyter_notebook_config.py  --no-browser -y --allow-root > d:\mywork\jupyter\jupyter.log 2>&1
D:\apply\Python373\Scripts\jupyter notebook --no-browser -y --allow-root > d:\mywork\jupyter\jupyter.log 2>&1

mkdir -p d:\mywork\jupyter\files 
    pip373 install --index-url=https://mirrors.huaweicloud.com/repository/pypi/simple --trusted-host=mirrors.huaweicloud.com ipykernel jupyter jupyterlab jupyter_contrib_nbextensions jupyter_nbextensions_configurator tqdm jupyterthemes autopep8
    D:\apply\Python373\Scripts\jupyter contrib nbextension install
    D:\apply\Python373\Scripts\jupyter nbextensions_configurator enable
    D:\apply\Python373\Scripts\jupyter nbextension enable codefolding/main
    D:\apply\Python373\Scripts\jupyter nbextension enable code_prettify/code_prettify
    D:\apply\Python373\Scripts\jupyter nbextension enable collapsible_headings/main
    D:\apply\Python373\Scripts\jupyter nbextension enable equation-numbering/main
    D:\apply\Python373\Scripts\jupyter nbextension enable highlight_selected_word/main
    D:\apply\Python373\Scripts\jupyter nbextension enable navigation-hotkeys/main
    D:\apply\Python373\Scripts\jupyter nbextension enable notify/notify
    D:\apply\Python373\Scripts\jupyter nbextension enable ruler/main
    D:\apply\Python373\Scripts\jupyter nbextension enable scroll_down/main
    D:\apply\Python373\Scripts\jupyter nbextension enable toc2/main
    D:\apply\Python373\Scripts\jupyter nbextension enable comment-uncomment/main
    D:\apply\Python373\Scripts\jupyter nbextension enable execute_time/ExecuteTime
    D:\apply\Python373\Scripts\jupyter nbextension enable export_embedded/main
    D:\apply\Python373\Scripts\jupyter nbextension enable highlighter/highlighter
    D:\apply\Python373\Scripts\jupyter nbextension enable livemdpreview/livemdpreview
    D:\apply\Python373\Scripts\jupyter nbextension enable ruler/edit
    D:\apply\Python373\Scripts\jupyter nbextension enable snippets_menu/main
    D:\apply\Python373\Scripts\jupyter nbextension enable table_beautifier/main
    D:\apply\Python373\Scripts\jupyter nbextension enable codefolding/edit
    D:\apply\Python373\Scripts\jupyter nbextension enable execution_dependencies/execution_dependencies
    D:\apply\Python373\Scripts\jupyter nbextension enable freeze/main
    D:\apply\Python373\Scripts\jupyter nbextension enable python-markdown/main
    D:\apply\Python373\Scripts\jupyter nbextension enable runtools/main
    D:\apply\Python373\Scripts\jupyter nbextension enable spellchecker/main
    D:\apply\Python373\Scripts\jupyter nbextension enable code_prettify/autopep8
    D:\apply\Python373\Scripts\jupyter nbextension enable datestamper/main
    D:\apply\Python373\Scripts\jupyter nbextension enable nbTranslate/main
    D:\apply\Python373\Scripts\jupyter nbextension enable scratchpad/main
    D:\apply\Python373\Scripts\jupyter nbextension enable tree-filter/index
    D:\apply\Python373\Scripts\jupyter notebook --generate-config -y
    /usr/bin/sed -i "s|#c.NotebookApp.notebook_dir = ''|c.NotebookApp.notebook_dir = '/app/jupyter/files/'|g"  /root/.jupyter/jupyter_notebook_config.py
    /usr/bin/sed -i "s|#c.NotebookApp.open_browser = True|c.NotebookApp.open_browser = False|g"  /root/.jupyter/jupyter_notebook_config.py
    /usr/bin/sed -i "s|#c.NotebookApp.ip = 'localhost'|c.NotebookApp.ip = '0.0.0.0'|g"  /root/.jupyter/jupyter_notebook_config.py
    /usr/bin/sed -i "s|#c.NotebookApp.port = 8888|c.NotebookApp.port = 12345|g"  /root/.jupyter/jupyter_notebook_config.py
    /usr/bin/sed -i "s|#c.NotebookApp.allow_remote_access = False|c.NotebookApp.allow_remote_access = True|g"  /root/.jupyter/jupyter_notebook_config.py
    passwd_sha=`/usr/bin/python373 -c "from notebook.auth import passwd;print(passwd('mima'));"`
    /usr/bin/sed -i "s|#c.NotebookApp.password = ''|c.NotebookApp.password = '$passwd_sha'|g"  /root/.jupyter/jupyter_notebook_config.py

/usr/local/python374/bin/jupyter contrib nbextension install
/usr/local/python374/bin/jupyter nbextensions_configurator enable
/usr/local/python374/bin/jupyter nbextension enable codefolding/main
/usr/local/python374/bin/jupyter nbextension enable code_prettify/code_prettify
/usr/local/python374/bin/jupyter nbextension enable collapsible_headings/main
/usr/local/python374/bin/jupyter nbextension enable equation-numbering/main
/usr/local/python374/bin/jupyter nbextension enable highlight_selected_word/main
/usr/local/python374/bin/jupyter nbextension enable navigation-hotkeys/main
/usr/local/python374/bin/jupyter nbextension enable notify/notify
/usr/local/python374/bin/jupyter nbextension enable ruler/main
/usr/local/python374/bin/jupyter nbextension enable scroll_down/main
/usr/local/python374/bin/jupyter nbextension enable toc2/main
/usr/local/python374/bin/jupyter nbextension enable comment-uncomment/main
/usr/local/python374/bin/jupyter nbextension enable execute_time/ExecuteTime
/usr/local/python374/bin/jupyter nbextension enable export_embedded/main
/usr/local/python374/bin/jupyter nbextension enable highlighter/highlighter
/usr/local/python374/bin/jupyter nbextension enable livemdpreview/livemdpreview
/usr/local/python374/bin/jupyter nbextension enable ruler/edit
/usr/local/python374/bin/jupyter nbextension enable snippets_menu/main
/usr/local/python374/bin/jupyter nbextension enable table_beautifier/main
/usr/local/python374/bin/jupyter nbextension enable codefolding/edit
/usr/local/python374/bin/jupyter nbextension enable execution_dependencies/execution_dependencies
/usr/local/python374/bin/jupyter nbextension enable freeze/main
/usr/local/python374/bin/jupyter nbextension enable python-markdown/main
/usr/local/python374/bin/jupyter nbextension enable runtools/main
/usr/local/python374/bin/jupyter nbextension enable spellchecker/main
/usr/local/python374/bin/jupyter nbextension enable code_prettify/autopep8
/usr/local/python374/bin/jupyter nbextension enable datestamper/main
/usr/local/python374/bin/jupyter nbextension enable nbTranslate/main
/usr/local/python374/bin/jupyter nbextension enable scratchpad/main
/usr/local/python374/bin/jupyter nbextension enable tree-filter/index

/usr/local/python374/bin/jupyter notebook --generate-config -y
    sed -i "s|#c.NotebookApp.notebook_dir = ''|c.NotebookApp.notebook_dir = '/home/my/my_works/jupyter/files/'|g"  /home/my/.jupyter/jupyter_notebook_config.py
    sed -i "s|#c.NotebookApp.open_browser = True|c.NotebookApp.open_browser = False|g" "/home/my/.jupyter/jupyter_notebook_config.py"
    sed -i "s|#c.NotebookApp.ip = 'localhost'|c.NotebookApp.ip = '0.0.0.0'|g" "/home/my/.jupyter/jupyter_notebook_config.py"
    sed -i "s|#c.NotebookApp.port = 8888|c.NotebookApp.port = 12345|g" "/home/my/.jupyter/jupyter_notebook_config.py"
    sed -i "s|#c.NotebookApp.allow_remote_access = False|c.NotebookApp.allow_remote_access = True|g" "/home/my/.jupyter/jupyter_notebook_config.py"
    passwd_sha=`/usr/bin/python374 -c "from notebook.auth import passwd;print(passwd('mima'));"`
    sed -i "s|#c.NotebookApp.password = ''|c.NotebookApp.password = '$passwd_sha'|g" "/home/my/.jupyter/jupyter_notebook_config.py"

 


3. sudo vi /etc/systemd/system/myjupyter.service
[Unit]
Description=Jupyter server
ConditionPathExists=/home/my/my_works/jupyter/rc.local
 
[Service]
Type=forking
ExecStart=/home/my/my_works/jupyter/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
 
[Install]
WantedBy=multi-user.target

4. vi /home/my/my_works/jupyter/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
echo "看到这行字,说明添加自启动脚本成功。" > /home/my/my_works/jupyter/logs/myjupyter.log
/usr/local/python374/bin/jupyter-notebook --config=/home/my/my_works/jupyter/config/jupyter_notebook_config.py  --no-browser -y --allow-root >> /home/my/my_works/jupyter/logs/myjupyter.log

exit 0

5、给rc.local加上权限
sudo chmod +x /home/my/my_works/jupyter/rc.local
6、启用服务
sudo systemctl enable myjupyter.service
7、启动服务并检查状态
sudo systemctl start myjupyter.service
sudo systemctl status myjupyter.service
8、重启并检查test.log文件
cat /home/my/my_works/jupyter/logs/myjupyter.log

 

© 著作权归作者所有

mbzhong
粉丝 1
博文 119
码字总数 73101
作品 0
济南
程序员
私信 提问
把jupyter-notebook装进docker里

jupyter-notebook是我很喜欢的工具,搭环境稍显麻烦,其实jupyter web形式的使用方式,最好的部署方式是在云上,一次部署到哪里都可以使用,岂不快哉。现在各家云服务器还挺贵的,docker出来...

JungleKing
2018/06/27
307
0
Heroku 快速搭建 免费高性能 Jupyter Notebook

Heroku 是一个支持多语言的PaaS。简单来说这是一个可以免费快速将自己的应用部署在上面的云平台。Heroku提供Heroku Buttons 来一键部署应用。我们可以使用 heroku-jupyter的脚本自动配置部署...

AvatarBB
2018/05/17
0
0
Pyenv/pyenv-virtualenv/jupyter的部署/安装/使用

安装pip #yum install python-setuptools sudo easy_install pip 一.pyenv https://github.com/yyuu/pyenv 安装依赖包: $ yum groupinstall "Development Tools" "Server Platform Developme......

390892467
2016/03/07
0
0
数据科学家Docker入门指南

Docker容器是通过虚拟化开发和部署应用程序的一种越来越流行的方式,它对数据科学家有用吗?当然,本指南就会向你介绍它的作用,并手把手教你快速入门。 介绍 Docker是一种越来越流行的,使在...

【方向】
2018/09/09
0
0
iObjects for Spark- Docker安装攻略

iObjects for Spark时空大数据分析引擎可以帮助使用者进行高效的时空大数据分析,它既可以作为Apache Spark项目在时空数据领域的扩展模块,为软件开发人员服务,也可以作为一个开箱即用的时空...

openthings
2016/10/25
157
0

没有更多内容

加载失败,请刷新页面

加载更多

Kafka 原理和实战

本文首发于 vivo互联网技术 微信公众号 https://mp.weixin.qq.com/s/bV8AhqAjQp4a_iXRfobkCQ 作者简介:郑志彬,毕业于华南理工大学计算机科学与技术(双语班)。先后从事过电子商务、开放平...

vivo互联网技术
今天
17
0
java数据类型

基本类型: 整型:Byte,short,int,long 浮点型:float,double 字符型:char 布尔型:boolean 引用类型: 类类型: 接口类型: 数组类型: Byte 1字节 八位 -128 -------- 127 short 2字节...

audience_1
今天
9
0
太全了|万字详解Docker架构原理、功能及使用

一、简介 1、了解Docker的前生LXC LXC为Linux Container的简写。可以提供轻量级的虚拟化,以便隔离进程和资源,而且不需要提供指令解释机制以及全虚拟化的其他复杂性。相当于C++中的NameSpa...

Java技术剑
今天
22
0
Wifiphisher —— 非常非常非常流氓的 WIFI 网络钓鱼框架

编者注:这是一个非常流氓的 WIFI 网络钓鱼工具,甚至可能是非法的工具(取决于你的使用场景)。在没有事先获得许可的情况下使用 Wifiphisher 攻击基础网络设施将被视为非法活动。使用时请遵...

红薯
今天
91
1
MongoDB 4 on CentOS 7安装指南

本教程为CentOS x86_64 7.x操作系统下,MongoDB Community x86_64 4.2(GA)安装指南。 安装方式一:yum repo在线安装 [此方式较为简单,官方推荐] Step1:新建MongDB社区版Yum镜像源。 # vim ...

王焱君
今天
15
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部