欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Jupyter notebook 遠(yuǎn)程配置及SSL加密教程

 更新時(shí)間:2020年04月14日 11:22:58   作者:谷明科技  
這篇文章主要介紹了Jupyter notebook 遠(yuǎn)程配置及SSL加密教程,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧

jupyter notebook的安裝在這里都不贅述

可以參考jupyter官網(wǎng)的步驟

http://jupyter-notebook.readthedocs.io/en/latest/public_server.html

這里討論下jupyter notebook里面的遠(yuǎn)程訪問(wèn)配置以及SSL加密

1. 遠(yuǎn)程訪問(wèn)配置

jupyter notebook --generate-config

這個(gè)命令會(huì)在當(dāng)前用戶的 ~/.jupyter/ 文件夾下面生成一個(gè) jupyter_notebook_config.py 文件

jupyter notebook password

可以生成你需要的遠(yuǎn)程密碼,自己填一下就好,密碼會(huì)直接輸出到 jupyter_notebook_config.json 文件

接下來(lái)編輯 jupyter_notebook_config.py 文件中的以下幾個(gè)部分:

# Set ip to '*' to bind on all interfaces (ips) for the public server
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False

# It is a good idea to set a known, fixed port for server access
c.NotebookApp.port = 9999

最后一個(gè)端口號(hào)根據(jù)自己的實(shí)際情況進(jìn)行設(shè)置

2. SSL加密配置

自己建一個(gè)文件夾或者干脆在~/.jupyter/ 文件夾下面執(zhí)行下面命令:

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mycert.pem -out mycert.pem

同時(shí)編輯 jupyter_notebook_config.py

# browser auto-opening
c.NotebookApp.certfile = u'路徑名/mycert.pem'

接下來(lái)啟動(dòng)

jupyter notebook

注意在訪問(wèn)時(shí)要使用https協(xié)議

補(bǔ)充知識(shí):jupyter notebook 中打開(kāi)ipynb文件時(shí)報(bào)錯(cuò) NameError: name 'true' is not defined

在jupyter notebook 中打開(kāi)ipynb文件時(shí)報(bào)錯(cuò):

File "e:\python36\lib\site-packages\traitlets\config\loader.py", line 457, in load_config
 self._read_file_as_dict()
 File "e:\python36\lib\site-packages\traitlets\config\loader.py", line 489, in _read_file_as_dict
 py3compat.execfile(conf_filename, namespace)
 File "e:\python36\lib\site-packages\ipython_genutils\py3compat.py", line 198, in execfile
 exec(compiler(f.read(), fname, 'exec'), glob, loc)
 File "C:\Users\xiaoqiu\.ipython\profile_default\ipython_config.py", line 513, in <module>
 c.Completer.greedy = true
NameError: name 'true' is not defined

resolution:

在執(zhí)行了ipython profile create 命令(激活自動(dòng)補(bǔ)全的功能)之后 C:\Users\xiaoqiu\.ipython\profile_default生成了兩個(gè)文件

需要修改ipython_config.py文件修改如下三個(gè)參數(shù)

以上這篇Jupyter notebook 遠(yuǎn)程配置及SSL加密教程就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論