Anaconda running as root is not recommended

在wsl中使用anaconda时,每次通过命令启动jupyter notebook 总是提示:

Running as root is not recommended. Use --allow-root to bypass.

所以每次想正常启动还得加上 --allow-root参数

下面是解决办法: 命令在shell中运行

生成config:

jupyter notebook --generate-config

会返回生成的config的路径:

(base) root@Andy963:/mnt/d/code/anaconda study# jupyter notebook --generate-config
Writing default config to: /root/.jupyter/jupyter_notebook_config.py

在jupyter_notebook_config.py中添加如下行:
 

#用vim编辑 vim /root/.jupyter/jupyter_notebook_config.py 
c.NotebookApp.allow_root=True

保存退出,这样就不用每次都加参数了

ref: https://stackoverflow.com/questions/41622988/root-access-for-jupyter-ipython-notebook

上一篇:Mysql delete与truncate区别

下一篇:Django 根据数据库表生成 model 类