我正在尝试使用iPython/Jupyter notebook中的bash内核,但我需要在notebook本身中使用sudo访问。
我尝试使用$ sudo jupyter notebook
以根用户身份运行笔记本,但结果只返回:
$ jupyter: 'notebook' is not a Jupyter command
因此,我只能运行$ jupyter notebook
(除非有办法以根用户身份运行Jupyter notebook )。
我也不能在notebook本身中执行su root
,因为这需要输入,而notebook不让我输入。
最后,据说Jupyter notebook还有一个--allow-root
选项:http://jupyter-notebook.readthedocs.io/en/latest/config.html
然而,看起来--allow_root
不再是一种选择。(我曾尝试通过添加NotebookApp.allow_root=True
来修改配置文件,但不起作用。)
有什么想法吗,伙计们?也许我做错了什么?
发布于 2018-02-15 08:48:12
只需以root用户身份登录,然后执行以下命令以启动notebook:
jupyter notebook --allow-root
发布于 2019-01-21 21:03:54
如here所述的解决方案。就是使用
sudo -E env "PATH=$PATH" jupyter notebook
基本上,调用jupyter notebook
的二进制文件在用户的PATH
变量中,而不是根目录。
诚挚的问候。
发布于 2017-08-25 20:22:59
从根配置文件添加c.NotebookApp.allow_root=True
。这样你就不需要在每次启动笔记本时都询问allow-root
。
编辑:
在编辑配置文件之前,您需要以根用户身份运行jupyter notebook --generate-config
来创建该文件。
https://stackoverflow.com/questions/41622988
复制相似问题