1.检查python 中pip install 安装包的路径
在cmd中输入
python import os os
2.升级pip,不然安装容易失败
首先直接在pip输入
pip3 install --upgrade pip
出现错误:“系统无法将文件移到不同的磁盘驱动器”
经查阅,输入以下命令解决:
python -m ensurepip python -m pip install -i https://mirrors.aliyun.com/pypi/simple/ --upgrade pip
3.安装 jupyter notebook
pip install jupyter notebook
4.运行看是否安装成功:
在cmd中输入
jupyter notebook
如果失败,则需要配置环境变量,在cmd中输入:
sysdm.cpl
5.成功后在IE打开jupyter notebook,复制到其他浏览器出现:
Password or token
这时复制cmd中的地址再粘贴到浏览器即可
6.jupyter notebook指定启动目录
6.1 临时进入某个目录
先在cmd中进入指定文件夹
cd /d f:\jupyter notebook
cd /d F:\Programing\Python language\jupyter notebook
再输入:
jupyter notebook
6.2 打开jupyter notebook 后 永远进入某指定目录作为启动目录
6.2.1
在cmd命令行中输入命令:
jupyter notebook --generate-config
生成配置文件
6.2.2修改配置文件
根据路径找到 jupyter_notebook_config.py,搜索 c.NotebookApp.notebook_dir ,去掉注释后将其改为(注意地址前面不能加 r 啥的,不然就失败了):
c.NotebookApp.notebook_dir = 'F:/Programing/Python language/jupyter notebook'
6.2.3建立快捷方式,直接打开 jupyter notebook
在启动目录内建立一个bat文件:
jupyter notebook.bat
里面写:
jupyter notebook
再建一个快捷方式即可