在树莓派上搭建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客户端图形界面远程访问. ...
随机推荐
- 【转】Linux内核中分配4M以上大内存的方法
在Linux内核中, kmalloc能够分配的最大连续内存为2的(MAX_ORDER-1)次方个page(参见alloc_pages函数, "if (unlikely(order & ...
- (转) 修改weblogic部署的应用名称
通过weblogic管理后台console进行发布本地项目的时候,它会默认以WEB-INF的上一级目录作为访问路径, 如,假如你的项目WEB-INF目录的上一层是WebRoot,那么发布后, 访问的路 ...
- At grand 024
A /* Huyyt */ #include <bits/stdc++.h> #define mem(a,b) memset(a,b,sizeof(a)) #define mkp(a,b) ...
- bootstrap-table(2)问题集
参考;https://www.cnblogs.com/landeanfen/p/4993979.html 1.分页参数sidePagination 如果是服务端分页,返回的结果必须包含total.ro ...
- Windows10家庭版的功能中没有Hyper-V的解决方法
1.在桌面新建记事本 将下面的内容复制到编辑器或者记事本当中 pushd "%~dp0" dir /b %SystemRoot%\servicing\Packages\*Hyper ...
- Java数组反转
public static void reverseArr(int[] arr) { /* 循环中定义变量min=0最小索引 max=arr.length‐1最大索引 min++,max‐‐ */ f ...
- mysql<六>
-- ########## 01.综合练习 ########## -- 使用的表结构来自前面创建的"教师授课.学生选课并有课程成绩"这个数据库设计 -- studentinfo.t ...
- CodeForces-687A(DFS,染色)
链接: https://vjudge.net/problem/CodeForces-687A 题意: Recently, Pari and Arya did some research about N ...
- shell练习--PAT题目1007:关于素数对(失败案例)
让我们定义dn为:dn=pn+1−pn,其中pi是第i个素数.显然有d1=1,且对于n>1有dn是偶数.“素数对猜想”认为“存在无穷多对相邻且差为2的素 ...
- linux 系统时间 硬件时间
Linux时钟分为系统时钟(System Clock)和硬件时钟(Real Time Clock,简称RTC).系统时钟是指当前Linux Kernel中的时钟:而硬件时钟则是主板上由电池供电的时钟, ...