配置jupyter notebook

为了确保环境独立,在docker里面安装

安装jupyter notebook

  pip install jupyter

 

生成配置文件

  jupyter notebook --generate-config

     

 

生成密码

  输入python

  >>> from notebook.auth import passwd

  >>> passwd()

     

 

修改配置

  vim /root/.jupyter/jupyter_notebook_config.py

  c.NotebookApp.ip='0.0.0.0'

  c.NotebookApp.password = 'argon2***' # 上面生成的密码

  c.NotebookApp.open_browser = False

  c.NotebookApp.port =8888 #随便指定一个端口,不要是443和80等重要端口

 

添加自动补全功能的插件 #(未测有效)

  pip install jupyter_contrib_nbextensions
  jupyter contrib nbextension install
  pip install jupyter_nbextensions_configurator
  jupyter nbextensions_configurator enable


启动jupyter notebook

  jupyter notebook  

  jupyter notebook --allow-root # root账号起(docker里)--allow-root

 

启用补全功能

  在阿里云中打开相应端口即可通过ip:端口访问Jupyter Notebook

  能看到增加了一个 Nbextensions 标签页,在这个页面里,勾选 Hinterland 即可

  

参考文献

https://jupitersh.github.io/2020/03/ubuntujupyter/

posted @ 2021-01-06 11:44  学渣Mia  阅读(133)  评论(0)    收藏  举报