在树莓派上搭建jupyter notebook server
自从搬家后,树莓派闲置了好一段时间,最近打算将其利用起来。想来想去,搭个jupyter notebook用要靠谱的,毕竟经常要实验一些Python脚本。
具体过程参考以下链接:
https://www.techcoil.com/blog/how-to-setup-jupyter-notebook-on-raspberry-pi-3-with-raspbian-stretch-lite-supervisor-and-virtualenv-to-run-python-3-codes/
教程中给出了在virtualenv中启动Python3版本的jupyter notebook server的方案,这样做的好处是可以方便地单独管理jupyter的包。在这个教程中,还发现了个人折腾启动服务的神器,supervisor,好评。
tips: 如果想要让jupyter同时支持Python2和Python3,安装对应的python2-ipykernel即可,此时Python2为
/usr/bin/python2
最后附上,根据教程编写的自动化脚本:
# 安装supervisor和virtualenv
apt install supervisor python3-virtualenv -y
# 在virtualenv中安装jupyter
python3 -m virtualenv -p python3 /home/pi/jupyter-env
source /home/pi/jupyter-env/bin/activate
pip install jupyter
deactivate
# 在virtualenv环境中启动jupyter
mkdir /home/pi/jupyter-notebook
chmod 777 /home/pi/jupyter-notebook
# # 设置jupyter启动脚本
(
cat << EOF
#!/bin/bash
source /home/pi/jupyter-env/bin/activate
jupyter notebook --ip 0.0.0.0 --port 9999 --no-browser
deactivate
EOF
) > /home/pi/jupyter-notebook/run-jupyter-notebook.sh
sudo chmod +x /home/pi/jupyter-notebook/run-jupyter-notebook.sh
# supervisor配置
(
cat << EOF
#!/bin/bash
[program:jupyter-notebook]
directory=/home/pi/jupyter-notebook
command=/bin/bash -E -c ./run-jupyter-notebook.sh
autostart=true
autorestart=true
stopsignal=INT
stopasgroup=true
killasgroup=true
user=pi
EOF
) > /etc/supervisor/conf.d/jupyter-notebook.conf
# 重启supervisor以启动jupyter notebook
systemctl restart supervisor.service
sleep 5
# 输出用于登录验证的token
supervisorctl tail jupyter-notebook stdout
在树莓派上搭建jupyter notebook server的更多相关文章
- 在Linux服务器上运行Jupyter notebook server教程
在Linux服务器上运行Jupyter notebook server教程 很多deep learning教程都推荐在jupyter notebook运行python代码,方便及时交互.但只在本地运行 ...
- vps上搭建jupyter notebook远程服务
安装anaconda 使用如下命令下载: wget https://repo.continuum.io/archive/Anaconda3-5.0.0.1-Linux-x86_64.sh 如果非roo ...
- 服务器上搭建jupyter notebook
参考:https://zhuanlan.zhihu.com/p/44405596 https://blog.csdn.net/cvMat/article/details/79351420 遇到的问题 ...
- 搭建Jupyter Notebook服务器
昨天发了Jupyter的使用,补一篇Jupyter服务器的搭建~ 一.搭建Jupyter 1.安装 使用virtualenv建虚拟环境.在虚拟环境中安装jupyter.matplotlib等等需要的库 ...
- 树莓派上搭建基于Python+web.py+fastcgi+lighttpd的网站
最近在网上淘了一个树莓派,什么是树莓派?这里是他的官方网站你可以去看看. 简单的说就是一块使用了ARM11的CPU,具有256MB或512MB内存的具有两个USB接口,一个RJ45接口,HDMI输出和 ...
- Python - 搭建Jupyter notebook环境
1- Jupyter简介 HomePage:https://jupyter.org/ 安装指南:https://jupyter.org/install.html 官方文档:https://jupyte ...
- 使用docker搭建jupyter notebook / jupyterlab
说明 由于官方镜像实在是不怎么好用,所以我自己做了一个优化过的jupyter notebook的镜像 notebook_hub,使用我这个镜像搭建容器非常简单,下面就基于这个notebook_hub来 ...
- 使用centos linux vps搭建jupyter notebook踩坑日记
今天我尝试用vps搭建在线jupyter notebook网站时遇到了这样一个问题: [W 21:48:07.243 NotebookApp] SSL Error on 9 ('171.115.101 ...
- 利用本地浏览器远程服务器上的jupyter notebook
windows中访问远程服务器的方式有很多种:使用windows系统自带的网络功能,直接输入服务器地址访问:使用putty软件远程访问:使用xftp软件登陆:还可以使用x2go客户端图形界面远程访问. ...
随机推荐
- docker 安装与使用的相关问题
Error response from daemon: i/o timeout $ sudo docker search centos Error response from daemon: Get ...
- Nginx Location规则
Nginx由内核和模块组成,其中内核的设计非常微小和简洁,完成的工作也非常简单,仅仅通过查找配置文件将客户端的请求映射到一个location block,而location是Nginx配置中的一个指令 ...
- PAT Advanced 1033 To Fill or Not to Fill (25 分)
With highways available, driving a car from Hangzhou to any other city is easy. But since the tank c ...
- Idea集成使用SVN教程
第一步:下载svn的客户端,通俗一点来说就是小乌龟啦!官网下载地址:https://tortoisesvn.net/downloads.html 下载之后直接安装就好了,但是要注意这里,选择安装所有的 ...
- SpringBoot之模板引擎
一.Thymeleaf 1.1 集成 templates 在 pom.xml 文件中添加依赖 <dependencies> ...... <dependency> <gr ...
- SpringMVC 向页面传值-Map、Model和ModelMap
除了使用ModelAndView方式外.还可以使用Map.Model和ModelMap来向前台页面传值 使用后面3种方式,都是在方法参数中,指定一个该类型的参数.例如: Java代码 @Request ...
- jmeter使用jdbc获取注册验证码进行注册
自动化工具测试注册功能时,往往会遇到验证码,这个烦人的验证码怎么能够解决掉呢? 通常有两种方法 让开发禁用注册码,或在测试环境写个固定的验证码 在jmeter中用 jdbc获取数据库中验证码 今天通过 ...
- JAVA笔记17-容器之一 图、Collection接口、Iterator接口(重要)
掌握1136: (1)1个图 (2)1个类:Collections (3)3个知识点:For(了解),Generic泛型,Auto-boxing/unboxing(自动打包/解包) (4)6个接口:C ...
- docker容器共享宿主机环境,从而为镜像体积减负
一.背景介绍 响应公司技术发展路线,开发的服务均需要将打成docker镜像,使用docker进行统一管理.可是随着服务越来越多,镜像也越来越多.每次制作镜像的时候都需要将依赖打进容器,这样一个jre的 ...
- mysql-5.6.45-linux-glibc2.12-x86_64.tar.gz下载安装
一 ,mysql下载 需要注册,可以通过组合url越过注册下载需要的包. 下载地址: https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.3 ...