Root access for Jupyter/iPython Notebook

前端 未结 8 1182
遇见更好的自我
遇见更好的自我 2021-02-07 13:50

I\'m trying to use the bash kernel in iPython/Jupyter notebook, but I need sudo access within the notebook itself.

I\'ve tried $ sudo jupyter notebook to ru

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-07 14:08

    In case anyone is still looking for an answer, this is what worked for me:

    sudo ~/.local/bin/jupyter-notebook --allow-root
    

    Switching user using su didn't work because I didn't have jupyter installed on root. Using just --allow-root by itself also didn't work for me. This allows you to run sudo with jupyter notebook without running into the issue of "notebook" not being a valid command. Because I am using a linux terminal, jupyter-notebook is installed at ~/.local/bin/jupyter-notebook. See After installing with pip, "jupyter: command not found" for more information about where jupyter may be installed.

提交回复
热议问题