Jupyter Notebook是基于网页的用于交互计算的应用程序。能让用户将说明文本、数学方程、代码和可视化内容全部组合到一个易于共享的文档中。
准备工作
更新软件包
sudo apt-get update
安装 python3(默认 python3 将安装最新版本,一般Ubuntu都自带python在 /usr/local目录下查看):
sudo apt-get install python3
安装python第三方安装工具:
sudo apt-get install python3-pip
版本信息查看:
python3 -V
安装jupyter notebook
pip3 install jupyter -i https://pypi.tuna.tsinghua.edu.cn/simple
运行 jupyter notebook:
jupyter notebook
也许会出现如下错误:
找出 jupyter:
find -name jupyter
方法一:
进入上述 bin 路径,运行 jupyter notebook:
~/.local/bin/jupyter-notebook
方法二(直接将上述路径添加到环境变量中):
编辑 ~/.bashrc 文件
sudo vim ~/.bashrc
添加如下内容:
export PATH=~/.local/bin:${PATH}
保存该文件后,执行source命令使上述配置在当前终端生效:
source ~/.bashrc
配置完环境变量后,每次就可以执行下述命令运行 jupyter notebook:
jupyter notebook