安装jupyter
安装jupyter常用指令如下
win+r 打开cmd窗口
pip安装
pip install jupyter --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple
生成config,然后修改默认的文件保存位置
jupyter notebook --generate-config
运行结果
Writing default config to: C:\Users\xxx\.jupyter\jupyter_notebook_config.py
打开jupyter_notebook_config.py搜索notebook_dir(大概在931行)
根据需要修改位置,此处我修改如下
c.ServerApp.notebook_dir = 'E:/jupyter_file'
在黑窗口中输入如下指令即可运行jupyter
jupyter notebook
默认情况下会自动打开浏览器,如果没有打开可以手动输入下指令
http://localhost:8888/tree
新建文件,输入指令,然后执行,即可发现在指定目录下已经创建了相关文件
print("hello")
补充部分功能
安装代码折叠功能
不用这个初始化时候会报错
pip install jupyter notebook==6.1.0
pip install jupyter_contrib_nbextensions -i https://pypi.tuna.tsinghua.edu.cn/simple
jupyter contrib nbextension install --user
pip install jupyter_nbextensions_configurator -i https://pypi.tuna.tsinghua.edu.cn/simple
jupyter nbextensions_configurator enable --user
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple scipy
其他问题补充
pip install ipympl
pip install nodejs
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyter-matplotlib
jupyter notebook
修改默认配置文件启动失败了,所以指定目录启动
jupyter notebook --notebook-dir='E:/jupyter_file'