12月 082020
 

一、安装运行:

  • pip3 install jupyter
  • jupyter notebook —generateconfig   (生成配置文件)
    • $ jupyter notebook –generate-config
    • Writing default config to: /Users/xxxxxx/.jupyter/jupyter_notebook_config.py
  • 生成jupyter 密码:
      • 方法一(one): 直接jupyter notebook password , 两次确认后直接写入配置文件(

        /Users/xxxxxx/.jupyter/jupyter_notebook_config.json

        ),完成。

      • 方法二(another):python命令行下执行
      • # 此时需要输入两次密码(一次设置,一次确认),然后生成sha1的密文,需拷贝下来填写到jupyter_notebook_config.py文件里
      • >>> from notebook.auth import passwd

        >>> passwd()

        Enter password:

        Verify password:

        ‘argon2:$argon2id$v=19$m=10240,t=10,p=8$LrRgSOg35ZZepMQiv+pSbQ$2SXyFdqy9vaWseqF7kWZHQ’

         

  • 修改配置文件jupyter_notebook_config.py
    • 在这个配置文件里关注两个:
    • c.NotebookApp.port = 8888  (服务端口,默认8888)

    • c.NotebookApp.password = ‘argon2:$argon2id$v=19$m=10240,t=10,p=8$LrRgSOg35ZZepMQiv+pSbQ$2SXyFdqy9vaWseqF7kWZHQ’    (密码,填入上面产生的密码。如果使用上面方法一产生密码此处都不用修改)

  • 启动jupyter(此处还可以在这里通过参数指定运行的端口,比如8080)
  • nohup jupyter notebook –no-browser —allow-root –ip=0.0.0.0 –port=8080  &

 

二、扩展,自动补全

  • pip3 install jupyter_contrib_nbextensions
  • jupyter contrib nbextension install –user –skip-running-check
  • pip3 install jupyter_nbextensions_configurator
  • 然后重新启动Jupyter Notebook后,就会发现已经有Nbextensions标签了。

常用扩展功能,勾选上即可:

DONE!!!

Sorry, the comment form is closed at this time.