jupyter notebook

I、更改Jupyter notebook中项目的默认路径

  1、打开Jupyter notebook:

    在cmd中输入jupyter notebook

  2.1、找到jupyter_notebook_config.py文件的位置

    

  2.2、修改jupyter_notebook_config.py

    

 

    如果修改不了的话,尽量把目录换成‘X:\JupyterkProject

  2.3、重启jupyter notebook

 

II、为jupyter notebook添加kernel

 Anaconda使用conda创建完虚拟环境后,启动jupyter notebook是找不到虚拟环境的。

 查看当前jupyter notebook依赖的是哪一个kernel(python.exe)

      import sys
      print(sys.executable)

   E:\Anaconda3\python.exe

 为jupyter notebook添加kernel依赖:

  1、创建虚拟环境:conda create -n huanjing python=3.7

  2、激活环境:activate huanjing

  3、安装ipykernel:conda install ipykernel

  4、将环境写入notebook的kernel中:python -m ipykernel install --user --name huanjing --display-name "huanjing "

  

III、报错(无法定位)

  1、在添加核心的过程中很容易出错,导致一直弹出一个无法定位的错误,这时可以删除添加的核心。

  jupyter notebook 删除指定kernel:

    第一步,查看所有核心:jupyter kernelspec list

    第二步:卸载指定核心:jupyter kernelspec remove kernel_name

  2、Dead Kernel

    建议从Anaconda中进入jupyter notebook

 

 



posted @ 2020-07-07 17:03  小吴的日常  阅读(287)  评论(0编辑  收藏  举报