Windows版本
下载jupyter
jupyter下载方法如下:
pip install --upgrade pip
pip install jupyter
Ubuntu18.04版本
sudo apt-get update
sudo apt-get install -y python3-pip
python3 -m pip install --upgrade pip
python3 -m pip install jupyter
但是这个时候运行jupyter notebook应该仍然查找不到该软件,可进行如下操作:
sudo vim ~/.bashrc
export PATH=~/.local/bin:${PATH} // 这个是jupyter的路径
source ~/.bashrc
jupyter notebook
修改启动目录
jupyter启动时会从默认目录启动,所以要修改它:
jupyter notebook --generate-config
这时可以看到你的jupyter_notebook_config.py的位置,如下:
C:\Users\[User_Name]\.jupyter\jupyter_notebook_config.py
打开它,找到如下位置:
## The directory to use for notebooks and kernels.
# Default: ''
c.NotebookApp.notebook_dir = r'xxxxxxx'
将dir替换成自己的目录
启动jupyter
在命令提示符中启动jupyter
jupyter notebook
这时就会发现它自动在网页端打开了该目录,可以编辑里面的文档了。
No module named ‘xx’
pip3 install matplotlib