翼度科技»论坛 编程开发 python 查看内容

Docker安装配置JupyterNotebook详解

6

主题

6

帖子

18

积分

新手上路

Rank: 1

积分
18
因为Docker Hub无法打开,Jupyter Notebook等官方镜像也无法下载,所以另辟蹊径下载了热门的Python3基础镜像,从头开始安装纯净版本的Jupyter Notebook环境,本文记录了完整的Jupyter Notebook安装过程,方便自己查阅,也供其他人员参考,请确保当前已有Docker运行环境
直接拉取最新Python镜像,映射宿主机与容器内部目录,因为目前只用到Notebook的Web服务,所以只映射了一个端口开放使用
  1. docker run -itd -p 2222:2222 -v /home/jupyter:/home/jupyter --name jupyter python
复制代码
进入镜像容器内部
  1. docker exec -it `容器编号` /bin/bash
复制代码
设置pip下载镜像源为清华
  1. pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
复制代码
下载jupyter,默认会下载最新版本7.X的Notebook,但是目前最新版本安装nbextensions插件会报错,所以这里下载6.X的Notebook最后版本
  1. pip install jupyter
复制代码
  1. pip install jupyter notebook==6.5.5
复制代码
生成Jupyter默认配置文件,并自定义配置选项
  1. jupyter notebook --generate-config
复制代码
生成配置文件后,控制台会打印生成的文件地址,通常是这个 /root/.jupyter/jupyter_notebook_config.py,如果生成的文件已经存在,会提示你是否需要覆盖,根据自己需要选择即可

因为此镜像没有Vim编辑器,我们可以按照如下步骤使用cat快速编辑保存配置


  • 使用cat jupyter_notebook_config.py命令查看配置文件,并选中复制到电脑文本中
  • 找到如下配置项,不同版本略有不同,但后缀相同,最后会附上当前完整配置以供参考

    • c.NotebookApp.allow_remote_access = True # 允许远程访问
    • c.NotebookApp.ip='0.0.0.0'  # 自动获取服务器ip
    • c.NotebookApp.allow_root =True  # 打开root权限启动
    • c.NotebookApp.open_browser = False #  服务端禁止自动打开浏览器
    • c.NotebookApp.port = 2222  # 创建docker时候配置的端口号

  • 上面设置项改完后,可以复制编辑好的全部配置文件,使用命令cat > jupyter_notebook_config.py ,覆盖当前所有配置,最后 Ctrl+D保存文本,也可以使用命令cat >> jupyter_notebook_config.py  追加自己更改的设置项
配置文件成功后,可以在当前目录使用命令 jupyter notebook启动服务,控制台没什么报错的话会打印Jupyter Notebook访问地址链接,复制好链接中的token后面的值,我们便可以在打开的页面中输入token值,用来设置初始访问密码

当然我们可以事先生成密码,然后设置到配置文件中,但是上面的方法更为简单,以下方法仅供参考


  • ipython
  • from notebook.auth import passwd
  • passwd()
  • Enter password: XXXX
  • Verify password: XXXX
  • Out[2]: '生成的密钥'
复制生成的密钥,填入配置文件的 c.NotebookApp.password 项中 注意前面有 u
示例 c.NotebookApp.password=u'生成的密钥'
后台运行Jupyter Notebook

上面使用命令jupyter notebook启动服务后,控制台不方便执行其他命令,可以先使用Ctrl+C中断服务,在当前目录下使用nohup jupyter notebook &以启动后台服务,默认当前目录为工作目录,新建的文件会保存在此处,也可以指定工作目录,如jupyter notebook --notebook-dir='工作目录地址',注意,如果当前端口存在冲突时,Jupyter服务的端口会自动顺延至下一个可用的端口,会导致服务无法访问,可以使用命令 ps aux |grep note查看当前是否已存在运行服务,然后使用kill -9 服务的PID杀掉对应进程
下载插件管理器nbextensions,并安装
  1. pip install jupyter_contrib_nbextensions && jupyter contrib nbextension install --user
复制代码
当前我开启的插件,根据自己需求来


  • Export Embedded HTML
  • RISE
  • Hinterland
  • Nbextensions dashboard tab
  • Table of Contents (2)
  • Variable Inspector
  • Code prettify
  • Hide input all
  • Nbextensions edit menu item
  • zenmode
使用主题(优雅的主题更舒心)
  1. pip install jupyterthemes
复制代码
可以使用 jt -ls 查看当前所有主题名称,jt -t 主题名称可以切换到对应主题,切换主题,通常无需重启Jupyter Notebook,刷新Notebook页面即可看到变化,最后可以使用jt -r还原为默认主题
附我当前使用的主题配置 jt -t gruvboxd -fs 12 -cellw 80% -ofs 11 -dfs 11 -T -N
说明 -f(字体)  -fs(字体大小) -cellw(占屏比或宽度)  -ofs(输出段的字号)  -T(显示工具栏)  -N(显示自己主机名)
看自己需要,是否需要安装下面插件


  • 报表展示 pip install plotly_express
  • 报表展示 pip install pyecharts
  • 查看当前系统环境信息 pip install watermark
  • 幻灯片插件 pip install rise
  1. %load_ext watermark
  2. %watermark
复制代码
查看当前Jupyter中已有的核心包版本
  1. jupyter --version
复制代码
附 jupyter-notebook完整配置文件
  1. # Configuration file for jupyter-notebook.
  2. c = get_config()  #noqa
  3. #------------------------------------------------------------------------------
  4. # Application(SingletonConfigurable) configuration
  5. #------------------------------------------------------------------------------
  6. ## This is an application.
  7. ## The date format used by logging formatters for %(asctime)s
  8. #  Default: '%Y-%m-%d %H:%M:%S'
  9. # c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S'
  10. ## The Logging format template
  11. #  Default: '[%(name)s]%(highlevel)s %(message)s'
  12. # c.Application.log_format = '[%(name)s]%(highlevel)s %(message)s'
  13. ## Set the log level by value or name.
  14. #  Choices: any of [0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL']
  15. #  Default: 30
  16. # c.Application.log_level = 30
  17. ## Configure additional log handlers.
  18. #
  19. #  The default stderr logs handler is configured by the log_level, log_datefmt
  20. #  and log_format settings.
  21. #
  22. #  This configuration can be used to configure additional handlers (e.g. to
  23. #  output the log to a file) or for finer control over the default handlers.
  24. #
  25. #  If provided this should be a logging configuration dictionary, for more
  26. #  information see:
  27. #  https://docs.python.org/3/library/logging.config.html#logging-config-
  28. #  dictschema
  29. #
  30. #  This dictionary is merged with the base logging configuration which defines
  31. #  the following:
  32. #
  33. #  * A logging formatter intended for interactive use called
  34. #    ``console``.
  35. #  * A logging handler that writes to stderr called
  36. #    ``console`` which uses the formatter ``console``.
  37. #  * A logger with the name of this application set to ``DEBUG``
  38. #    level.
  39. #
  40. #  This example adds a new handler that writes to a file:
  41. #
  42. #  .. code-block:: python
  43. #
  44. #     c.Application.logging_config = {
  45. #         'handlers': {
  46. #             'file': {
  47. #                 'class': 'logging.FileHandler',
  48. #                 'level': 'DEBUG',
  49. #                 'filename': '<path/to/file>',
  50. #             }
  51. #         },
  52. #         'loggers': {
  53. #             '<application-name>': {
  54. #                 'level': 'DEBUG',
  55. #                 # NOTE: if you don't list the default "console"
  56. #                 # handler here then it will be disabled
  57. #                 'handlers': ['console', 'file'],
  58. #             },
  59. #         }
  60. #     }
  61. #  Default: {}
  62. # c.Application.logging_config = {}
  63. ## Instead of starting the Application, dump configuration to stdout
  64. #  Default: False
  65. # c.Application.show_config = False
  66. ## Instead of starting the Application, dump configuration to stdout (as JSON)
  67. #  Default: False
  68. # c.Application.show_config_json = False
  69. #------------------------------------------------------------------------------
  70. # JupyterApp(Application) configuration
  71. #------------------------------------------------------------------------------
  72. ## Base class for Jupyter applications
  73. ## Answer yes to any prompts.
  74. #  Default: False
  75. # c.JupyterApp.answer_yes = False
  76. ## Full path of a config file.
  77. #  Default: ''
  78. # c.JupyterApp.config_file = ''
  79. ## Specify a config file to load.
  80. #  Default: ''
  81. # c.JupyterApp.config_file_name = ''
  82. ## Generate default config file.
  83. #  Default: False
  84. # c.JupyterApp.generate_config = False
  85. ## The date format used by logging formatters for %(asctime)s
  86. #  See also: Application.log_datefmt
  87. # c.JupyterApp.log_datefmt = '%Y-%m-%d %H:%M:%S'
  88. ## The Logging format template
  89. #  See also: Application.log_format
  90. # c.JupyterApp.log_format = '[%(name)s]%(highlevel)s %(message)s'
  91. ## Set the log level by value or name.
  92. #  See also: Application.log_level
  93. # c.JupyterApp.log_level = 30
  94. ##
  95. #  See also: Application.logging_config
  96. # c.JupyterApp.logging_config = {}
  97. ## Instead of starting the Application, dump configuration to stdout
  98. #  See also: Application.show_config
  99. # c.JupyterApp.show_config = False
  100. ## Instead of starting the Application, dump configuration to stdout (as JSON)
  101. #  See also: Application.show_config_json
  102. # c.JupyterApp.show_config_json = False
  103. #------------------------------------------------------------------------------
  104. # NotebookApp(JupyterApp) configuration
  105. #------------------------------------------------------------------------------
  106. ## Set the Access-Control-Allow-Credentials: true header
  107. #  Default: False
  108. # c.NotebookApp.allow_credentials = False
  109. ## Set the Access-Control-Allow-Origin header
  110. #
  111. #          Use '*' to allow any origin to access your server.
  112. #
  113. #          Takes precedence over allow_origin_pat.
  114. #  Default: ''
  115. # c.NotebookApp.allow_origin = ''
  116. ## Use a regular expression for the Access-Control-Allow-Origin header
  117. #
  118. #          Requests from an origin matching the expression will get replies with:
  119. #
  120. #              Access-Control-Allow-Origin: origin
  121. #
  122. #          where `origin` is the origin of the request.
  123. #
  124. #          Ignored if allow_origin is set.
  125. #  Default: ''
  126. # c.NotebookApp.allow_origin_pat = ''
  127. ## Allow password to be changed at login for the notebook server.
  128. #
  129. #                      While logging in with a token, the notebook server UI will give the opportunity to
  130. #                      the user to enter a new password at the same time that will replace
  131. #                      the token login mechanism.
  132. #
  133. #                      This can be set to false to prevent changing password from
  134. #  the UI/API.
  135. #  Default: True
  136. # c.NotebookApp.allow_password_change = True
  137. ## Allow requests where the Host header doesn't point to a local server
  138. #
  139. #         By default, requests get a 403 forbidden response if the 'Host' header
  140. #         shows that the browser thinks it's on a non-local domain.
  141. #         Setting this option to True disables this check.
  142. #
  143. #         This protects against 'DNS rebinding' attacks, where a remote web server
  144. #         serves you a page and then changes its DNS to send later requests to a
  145. #         local IP, bypassing same-origin checks.
  146. #
  147. #         Local IP addresses (such as 127.0.0.1 and ::1) are allowed as local,
  148. #         along with hostnames configured in local_hostnames.
  149. #  Default: False
  150. c.NotebookApp.allow_remote_access = True
  151. ## Whether to allow the user to run the notebook as root.
  152. #  Default: False
  153. c.NotebookApp.allow_root = True
  154. ## Answer yes to any prompts.
  155. #  See also: JupyterApp.answer_yes
  156. # c.NotebookApp.answer_yes = False
  157. ## "
  158. #          Require authentication to access prometheus metrics.
  159. #  Default: True
  160. # c.NotebookApp.authenticate_prometheus = True
  161. ## Reload the webapp when changes are made to any Python src files.
  162. #  Default: False
  163. # c.NotebookApp.autoreload = False
  164. ## DEPRECATED use base_url
  165. #  Default: '/'
  166. # c.NotebookApp.base_project_url = '/'
  167. ## The base URL for the notebook server.
  168. #
  169. #                                 Leading and trailing slashes can be omitted,
  170. #                                 and will automatically be added.
  171. #  Default: '/'
  172. # c.NotebookApp.base_url = '/'
  173. ## Specify what command to use to invoke a web
  174. #                        browser when opening the notebook. If not specified, the
  175. #                        default browser will be determined by the `webbrowser`
  176. #                        standard library module, which allows setting of the
  177. #                        BROWSER environment variable to override it.
  178. #  Default: ''
  179. # c.NotebookApp.browser = ''
  180. ## The full path to an SSL/TLS certificate file.
  181. #  Default: ''
  182. # c.NotebookApp.certfile = ''
  183. ## The full path to a certificate authority certificate for SSL/TLS client
  184. #  authentication.
  185. #  Default: ''
  186. # c.NotebookApp.client_ca = ''
  187. ## Full path of a config file.
  188. #  See also: JupyterApp.config_file
  189. # c.NotebookApp.config_file = ''
  190. ## Specify a config file to load.
  191. #  See also: JupyterApp.config_file_name
  192. # c.NotebookApp.config_file_name = ''
  193. ## The config manager class to use
  194. #  Default: 'notebook.services.config.manager.ConfigManager'
  195. # c.NotebookApp.config_manager_class = 'notebook.services.config.manager.ConfigManager'
  196. ## The notebook manager class to use.
  197. #  Default: 'notebook.services.contents.largefilemanager.LargeFileManager'
  198. # c.NotebookApp.contents_manager_class = 'notebook.services.contents.largefilemanager.LargeFileManager'
  199. ## Extra keyword arguments to pass to `set_secure_cookie`. See tornado's
  200. #  set_secure_cookie docs for details.
  201. #  Default: {}
  202. # c.NotebookApp.cookie_options = {}
  203. ## The random bytes used to secure cookies.
  204. #          By default this is a new random number every time you start the Notebook.
  205. #          Set it to a value in a config file to enable logins to persist across server sessions.
  206. #
  207. #          Note: Cookie secrets should be kept private, do not share config files with
  208. #          cookie_secret stored in plaintext (you can read the value from a file).
  209. #  Default: b''
  210. # c.NotebookApp.cookie_secret = b''
  211. ## The file where the cookie secret is stored.
  212. #  Default: ''
  213. # c.NotebookApp.cookie_secret_file = ''
  214. ## Override URL shown to users.
  215. #
  216. #          Replace actual URL, including protocol, address, port and base URL,
  217. #          with the given value when displaying URL to the users. Do not change
  218. #          the actual connection URL. If authentication token is enabled, the
  219. #          token is added to the custom URL automatically.
  220. #
  221. #          This option is intended to be used when the URL to display to the user
  222. #          cannot be determined reliably by the Jupyter notebook server (proxified
  223. #          or containerized setups for example).
  224. #  Default: ''
  225. # c.NotebookApp.custom_display_url = ''
  226. ## The default URL to redirect to from `/`
  227. #  Default: '/tree'
  228. # c.NotebookApp.default_url = '/tree'
  229. ## Disable cross-site-request-forgery protection
  230. #
  231. #          Jupyter notebook 4.3.1 introduces protection from cross-site request forgeries,
  232. #          requiring API requests to either:
  233. #
  234. #          - originate from pages served by this server (validated with XSRF cookie and token), or
  235. #          - authenticate with a token
  236. #
  237. #          Some anonymous compute resources still desire the ability to run code,
  238. #          completely without authentication.
  239. #          These services can disable all authentication and security checks,
  240. #          with the full knowledge of what that implies.
  241. #  Default: False
  242. # c.NotebookApp.disable_check_xsrf = False
  243. ## Whether to enable MathJax for typesetting math/TeX
  244. #
  245. #          MathJax is the javascript library Jupyter uses to render math/LaTeX. It is
  246. #          very large, so you may want to disable it if you have a slow internet
  247. #          connection, or for offline use of the notebook.
  248. #
  249. #          When disabled, equations etc. will appear as their untransformed TeX
  250. #  source.
  251. #  Default: True
  252. # c.NotebookApp.enable_mathjax = True
  253. ## extra paths to look for Javascript notebook extensions
  254. #  Default: []
  255. # c.NotebookApp.extra_nbextensions_path = []
  256. ## handlers that should be loaded at higher priority than the default services
  257. #  Default: []
  258. # c.NotebookApp.extra_services = []
  259. ## Extra paths to search for serving static files.
  260. #
  261. #          This allows adding javascript/css to be available from the notebook server machine,
  262. #          or overriding individual files in the IPython
  263. #  Default: []
  264. # c.NotebookApp.extra_static_paths = []
  265. ## Extra paths to search for serving jinja templates.
  266. #
  267. #          Can be used to override templates from notebook.templates.
  268. #  Default: []
  269. # c.NotebookApp.extra_template_paths = []
  270. #  Default: ''
  271. # c.NotebookApp.file_to_run = ''
  272. ## Generate default config file.
  273. #  See also: JupyterApp.generate_config
  274. # c.NotebookApp.generate_config = False
  275. ## Extra keyword arguments to pass to `get_secure_cookie`. See tornado's
  276. #  get_secure_cookie docs for details.
  277. #  Default: {}
  278. # c.NotebookApp.get_secure_cookie_kwargs = {}
  279. ## Deprecated: Use minified JS file or not, mainly use during dev to avoid JS
  280. #  recompilation
  281. #  Default: False
  282. # c.NotebookApp.ignore_minified_js = False
  283. ## (bytes/sec)
  284. #          Maximum rate at which stream output can be sent on iopub before they are
  285. #          limited.
  286. #  Default: 1000000
  287. # c.NotebookApp.iopub_data_rate_limit = 1000000
  288. ## (msgs/sec)
  289. #          Maximum rate at which messages can be sent on iopub before they are
  290. #          limited.
  291. #  Default: 1000
  292. # c.NotebookApp.iopub_msg_rate_limit = 1000
  293. ## The IP address the notebook server will listen on.
  294. #  Default: 'localhost'
  295. c.NotebookApp.ip = '0.0.0.0'
  296. ## Supply extra arguments that will be passed to Jinja environment.
  297. #  Default: {}
  298. # c.NotebookApp.jinja_environment_options = {}
  299. ## Extra variables to supply to jinja templates when rendering.
  300. #  Default: {}
  301. # c.NotebookApp.jinja_template_vars = {}
  302. ## The kernel manager class to use.
  303. #  Default: 'notebook.services.kernels.kernelmanager.MappingKernelManager'
  304. # c.NotebookApp.kernel_manager_class = 'notebook.services.kernels.kernelmanager.MappingKernelManager'
  305. ## The kernel spec manager class to use. Should be a subclass of
  306. #  `jupyter_client.kernelspec.KernelSpecManager`.
  307. #
  308. #  The Api of KernelSpecManager is provisional and might change without warning
  309. #  between this version of Jupyter and the next stable one.
  310. #  Default: 'jupyter_client.kernelspec.KernelSpecManager'
  311. # c.NotebookApp.kernel_spec_manager_class = 'jupyter_client.kernelspec.KernelSpecManager'
  312. ## The full path to a private key file for usage with SSL/TLS.
  313. #  Default: ''
  314. # c.NotebookApp.keyfile = ''
  315. ## Hostnames to allow as local when allow_remote_access is False.
  316. #
  317. #         Local IP addresses (such as 127.0.0.1 and ::1) are automatically accepted
  318. #         as local as well.
  319. #  Default: ['localhost']
  320. # c.NotebookApp.local_hostnames = ['localhost']
  321. ## The date format used by logging formatters for %(asctime)s
  322. #  See also: Application.log_datefmt
  323. # c.NotebookApp.log_datefmt = '%Y-%m-%d %H:%M:%S'
  324. ## The Logging format template
  325. #  See also: Application.log_format
  326. # c.NotebookApp.log_format = '[%(name)s]%(highlevel)s %(message)s'
  327. ## Set to True to enable JSON formatted logs. Run "pip install notebook[json-
  328. #  logging]" to install the required dependent packages. Can also be set using
  329. #  the environment variable JUPYTER_ENABLE_JSON_LOGGING=true.
  330. #  Default: False
  331. # c.NotebookApp.log_json = False
  332. ## Set the log level by value or name.
  333. #  See also: Application.log_level
  334. # c.NotebookApp.log_level = 30
  335. ##
  336. #  See also: Application.logging_config
  337. # c.NotebookApp.logging_config = {}
  338. ## The login handler class to use.
  339. #  Default: 'notebook.auth.login.LoginHandler'
  340. # c.NotebookApp.login_handler_class = 'notebook.auth.login.LoginHandler'
  341. ## The logout handler class to use.
  342. #  Default: 'notebook.auth.logout.LogoutHandler'
  343. # c.NotebookApp.logout_handler_class = 'notebook.auth.logout.LogoutHandler'
  344. ## The MathJax.js configuration file that is to be used.
  345. #  Default: 'TeX-AMS-MML_HTMLorMML-full,Safe'
  346. # c.NotebookApp.mathjax_config = 'TeX-AMS-MML_HTMLorMML-full,Safe'
  347. ## A custom url for MathJax.js.
  348. #          Should be in the form of a case-sensitive url to MathJax,
  349. #          for example:  /static/components/MathJax/MathJax.js
  350. #  Default: ''
  351. # c.NotebookApp.mathjax_url = ''
  352. ## Sets the maximum allowed size of the client request body, specified in the
  353. #  Content-Length request header field. If the size in a request exceeds the
  354. #  configured value, a malformed HTTP message is returned to the client.
  355. #
  356. #  Note: max_body_size is applied even in streaming mode.
  357. #  Default: 536870912
  358. # c.NotebookApp.max_body_size = 536870912
  359. ## Gets or sets the maximum amount of memory, in bytes, that is allocated for use
  360. #  by the buffer manager.
  361. #  Default: 536870912
  362. # c.NotebookApp.max_buffer_size = 536870912
  363. ## Gets or sets a lower bound on the open file handles process resource limit.
  364. #  This may need to be increased if you run into an OSError: [Errno 24] Too many
  365. #  open files. This is not applicable when running on Windows.
  366. #  Default: 0
  367. # c.NotebookApp.min_open_files_limit = 0
  368. ## Dict of Python modules to load as notebook server extensions. Entry values can
  369. #  be used to enable and disable the loading of the extensions. The extensions
  370. #  will be loaded in alphabetical order.
  371. #  Default: {}
  372. # c.NotebookApp.nbserver_extensions = {}
  373. ## The directory to use for notebooks and kernels.
  374. #  Default: ''
  375. # c.NotebookApp.notebook_dir = ''
  376. ## Whether to open in a browser after starting.
  377. #                          The specific browser used is platform dependent and
  378. #                          determined by the python standard library `webbrowser`
  379. #                          module, unless it is overridden using the --browser
  380. #                          (NotebookApp.browser) configuration option.
  381. #  Default: True
  382. c.NotebookApp.open_browser = False
  383. ## Hashed password to use for web authentication.
  384. #
  385. #                        To generate, type in a python/IPython shell:
  386. #
  387. #                          from notebook.auth import passwd; passwd()
  388. #
  389. #                        The string should be of the form type:salt:hashed-
  390. #  password.
  391. #  Default: ''
  392. # c.NotebookApp.password = ''
  393. ## Forces users to use a password for the Notebook server.
  394. #                        This is useful in a multi user environment, for instance when
  395. #                        everybody in the LAN can access each other's machine through ssh.
  396. #
  397. #                        In such a case, serving the notebook server on localhost is not secure
  398. #                        since any user can connect to the notebook server via ssh.
  399. #  Default: False
  400. # c.NotebookApp.password_required = False
  401. ## The port the notebook server will listen on (env: JUPYTER_PORT).
  402. #  Default: 8888
  403. c.NotebookApp.port = 2222
  404. ## The number of additional ports to try if the specified port is not available
  405. #  (env: JUPYTER_PORT_RETRIES).
  406. #  Default: 50
  407. # c.NotebookApp.port_retries = 50
  408. ## DISABLED: use %pylab or %matplotlib in the notebook to enable matplotlib.
  409. #  Default: 'disabled'
  410. # c.NotebookApp.pylab = 'disabled'
  411. ## If True, display a button in the dashboard to quit
  412. #          (shutdown the notebook server).
  413. #  Default: True
  414. # c.NotebookApp.quit_button = True
  415. ## (sec) Time window used to
  416. #          check the message and data rate limits.
  417. #  Default: 3
  418. # c.NotebookApp.rate_limit_window = 3
  419. ## Reraise exceptions encountered loading server extensions?
  420. #  Default: False
  421. # c.NotebookApp.reraise_server_extension_failures = False
  422. ## DEPRECATED use the nbserver_extensions dict instead
  423. #  Default: []
  424. # c.NotebookApp.server_extensions = []
  425. ## The session manager class to use.
  426. #  Default: 'notebook.services.sessions.sessionmanager.SessionManager'
  427. # c.NotebookApp.session_manager_class = 'notebook.services.sessions.sessionmanager.SessionManager'
  428. ## Whether the banner is displayed on the page.
  429. #
  430. #                          By default, the banner is displayed.
  431. #  Default: True
  432. # c.NotebookApp.show_banner = True
  433. ## Instead of starting the Application, dump configuration to stdout
  434. #  See also: Application.show_config
  435. # c.NotebookApp.show_config = False
  436. ## Instead of starting the Application, dump configuration to stdout (as JSON)
  437. #  See also: Application.show_config_json
  438. # c.NotebookApp.show_config_json = False
  439. ## Shut down the server after N seconds with no kernels or terminals running and
  440. #  no activity. This can be used together with culling idle kernels
  441. #  (MappingKernelManager.cull_idle_timeout) to shutdown the notebook server when
  442. #  it's not in use. This is not precisely timed: it may shut down up to a minute
  443. #  later. 0 (the default) disables this automatic shutdown.
  444. #  Default: 0
  445. # c.NotebookApp.shutdown_no_activity_timeout = 0
  446. ## The UNIX socket the notebook server will listen on.
  447. #  Default: ''
  448. # c.NotebookApp.sock = ''
  449. ## The permissions mode for UNIX socket creation (default: 0600).
  450. #  Default: '0600'
  451. # c.NotebookApp.sock_mode = '0600'
  452. ## Supply SSL options for the tornado HTTPServer.
  453. #              See the tornado docs for details.
  454. #  Default: {}
  455. # c.NotebookApp.ssl_options = {}
  456. ## Supply overrides for terminado. Currently only supports "shell_command". On
  457. #  Unix, if "shell_command" is not provided, a non-login shell is launched by
  458. #  default when the notebook server is connected to a terminal, a login shell
  459. #  otherwise.
  460. #  Default: {}
  461. # c.NotebookApp.terminado_settings = {}
  462. ## Set to False to disable terminals.
  463. #
  464. #           This does *not* make the notebook server more secure by itself.
  465. #           Anything the user can in a terminal, they can also do in a notebook.
  466. #
  467. #           Terminals may also be automatically disabled if the terminado package
  468. #           is not available.
  469. #  Default: True
  470. # c.NotebookApp.terminals_enabled = True
  471. ## Token used for authenticating first-time connections to the server.
  472. #
  473. #          The token can be read from the file referenced by JUPYTER_TOKEN_FILE or set directly
  474. #          with the JUPYTER_TOKEN environment variable.
  475. #
  476. #          When no password is enabled,
  477. #          the default is to generate a new, random token.
  478. #
  479. #          Setting to an empty string disables authentication altogether, which
  480. #  is NOT RECOMMENDED.
  481. #  Default: '<generated>'
  482. # c.NotebookApp.token = '<generated>'
  483. ## Supply overrides for the tornado.web.Application that the Jupyter notebook
  484. #  uses.
  485. #  Default: {}
  486. # c.NotebookApp.tornado_settings = {}
  487. ## Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded-
  488. #  For headers sent by the upstream reverse proxy. Necessary if the proxy handles
  489. #  SSL
  490. #  Default: False
  491. # c.NotebookApp.trust_xheaders = False
  492. ## Disable launching browser by redirect file
  493. #
  494. #          For versions of notebook > 5.7.2, a security feature measure was added that
  495. #          prevented the authentication token used to launch the browser from being visible.
  496. #          This feature makes it difficult for other users on a multi-user system from
  497. #          running code in your Jupyter session as you.
  498. #
  499. #          However, some environments (like Windows Subsystem for Linux (WSL) and Chromebooks),
  500. #          launching a browser using a redirect file can lead the browser failing to load.
  501. #          This is because of the difference in file structures/paths between the runtime and
  502. #          the browser.
  503. #
  504. #          Disabling this setting to False will disable this behavior, allowing the browser
  505. #          to launch by using a URL and visible token (as before).
  506. #  Default: True
  507. # c.NotebookApp.use_redirect_file = True
  508. ## DEPRECATED, use tornado_settings
  509. #  Default: {}
  510. # c.NotebookApp.webapp_settings = {}
  511. ## Specify Where to open the notebook on startup. This is the
  512. #          `new` argument passed to the standard library method `webbrowser.open`.
  513. #          The behaviour is not guaranteed, but depends on browser support. Valid
  514. #          values are:
  515. #
  516. #           - 2 opens a new tab,
  517. #           - 1 opens a new window,
  518. #           - 0 opens in an existing window.
  519. #
  520. #          See the `webbrowser.open` documentation for details.
  521. #  Default: 2
  522. # c.NotebookApp.webbrowser_open_new = 2
  523. ## Set the tornado compression options for websocket connections.
  524. #
  525. #  This value will be returned from
  526. #  :meth:`WebSocketHandler.get_compression_options`. None (default) will disable
  527. #  compression. A dict (even an empty one) will enable compression.
  528. #
  529. #  See the tornado docs for WebSocketHandler.get_compression_options for details.
  530. #  Default: None
  531. # c.NotebookApp.websocket_compression_options = None
  532. ## The base URL for websockets,
  533. #          if it differs from the HTTP server (hint: it almost certainly doesn't).
  534. #
  535. #          Should be in the form of an HTTP origin: ws[s]://hostname[:port]
  536. #  Default: ''
  537. # c.NotebookApp.websocket_url = ''
  538. #------------------------------------------------------------------------------
  539. # ConnectionFileMixin(LoggingConfigurable) configuration
  540. #------------------------------------------------------------------------------
  541. ## Mixin for configurable classes that work with connection files
  542. ## JSON file in which to store connection info [default: kernel-<pid>.json]
  543. #
  544. #      This file will contain the IP, ports, and authentication key needed to connect
  545. #      clients to this kernel. By default, this file will be created in the security dir
  546. #      of the current profile, but can be specified by absolute path.
  547. #  Default: ''
  548. # c.ConnectionFileMixin.connection_file = ''
  549. ## set the control (ROUTER) port [default: random]
  550. #  Default: 0
  551. # c.ConnectionFileMixin.control_port = 0
  552. ## set the heartbeat port [default: random]
  553. #  Default: 0
  554. # c.ConnectionFileMixin.hb_port = 0
  555. ## set the iopub (PUB) port [default: random]
  556. #  Default: 0
  557. # c.ConnectionFileMixin.iopub_port = 0
  558. ## Set the kernel's IP address [default localhost].
  559. #          If the IP address is something other than localhost, then
  560. #          Consoles on other machines will be able to connect
  561. #          to the Kernel, so be careful!
  562. #  Default: ''
  563. # c.ConnectionFileMixin.ip = ''
  564. ## set the shell (ROUTER) port [default: random]
  565. #  Default: 0
  566. # c.ConnectionFileMixin.shell_port = 0
  567. ## set the stdin (ROUTER) port [default: random]
  568. #  Default: 0
  569. # c.ConnectionFileMixin.stdin_port = 0
  570. #  Choices: any of ['tcp', 'ipc'] (case-insensitive)
  571. #  Default: 'tcp'
  572. # c.ConnectionFileMixin.transport = 'tcp'
  573. #------------------------------------------------------------------------------
  574. # KernelManager(ConnectionFileMixin) configuration
  575. #------------------------------------------------------------------------------
  576. ## Manages a single kernel in a subprocess on this host.
  577. #
  578. #      This version starts kernels with Popen.
  579. ## Should we autorestart the kernel if it dies.
  580. #  Default: True
  581. # c.KernelManager.autorestart = True
  582. ## JSON file in which to store connection info [default: kernel-<pid>.json]
  583. #  See also: ConnectionFileMixin.connection_file
  584. # c.KernelManager.connection_file = ''
  585. ## set the control (ROUTER) port [default: random]
  586. #  See also: ConnectionFileMixin.control_port
  587. # c.KernelManager.control_port = 0
  588. ## set the heartbeat port [default: random]
  589. #  See also: ConnectionFileMixin.hb_port
  590. # c.KernelManager.hb_port = 0
  591. ## set the iopub (PUB) port [default: random]
  592. #  See also: ConnectionFileMixin.iopub_port
  593. # c.KernelManager.iopub_port = 0
  594. ## Set the kernel's IP address [default localhost].
  595. #  See also: ConnectionFileMixin.ip
  596. # c.KernelManager.ip = ''
  597. ## set the shell (ROUTER) port [default: random]
  598. #  See also: ConnectionFileMixin.shell_port
  599. # c.KernelManager.shell_port = 0
  600. ## Time to wait for a kernel to terminate before killing it, in seconds. When a
  601. #  shutdown request is initiated, the kernel will be immediately sent an
  602. #  interrupt (SIGINT), followedby a shutdown_request message, after 1/2 of
  603. #  `shutdown_wait_time`it will be sent a terminate (SIGTERM) request, and finally
  604. #  at the end of `shutdown_wait_time` will be killed (SIGKILL). terminate and
  605. #  kill may be equivalent on windows.  Note that this value can beoverridden by
  606. #  the in-use kernel provisioner since shutdown times mayvary by provisioned
  607. #  environment.
  608. #  Default: 5.0
  609. # c.KernelManager.shutdown_wait_time = 5.0
  610. ## set the stdin (ROUTER) port [default: random]
  611. #  See also: ConnectionFileMixin.stdin_port
  612. # c.KernelManager.stdin_port = 0
  613. #  See also: ConnectionFileMixin.transport
  614. # c.KernelManager.transport = 'tcp'
  615. #------------------------------------------------------------------------------
  616. # Session(Configurable) configuration
  617. #------------------------------------------------------------------------------
  618. ## Object for handling serialization and sending of messages.
  619. #
  620. #      The Session object handles building messages and sending them
  621. #      with ZMQ sockets or ZMQStream objects.  Objects can communicate with each
  622. #      other over the network via Session objects, and only need to work with the
  623. #      dict-based IPython message spec. The Session will handle
  624. #      serialization/deserialization, security, and metadata.
  625. #
  626. #      Sessions support configurable serialization via packer/unpacker traits,
  627. #      and signing with HMAC digests via the key/keyfile traits.
  628. #
  629. #      Parameters
  630. #      ----------
  631. #
  632. #      debug : bool
  633. #          whether to trigger extra debugging statements
  634. #      packer/unpacker : str : 'json', 'pickle' or import_string
  635. #          importstrings for methods to serialize message parts.  If just
  636. #          'json' or 'pickle', predefined JSON and pickle packers will be used.
  637. #          Otherwise, the entire importstring must be used.
  638. #
  639. #          The functions must accept at least valid JSON input, and output
  640. #  *bytes*.
  641. #
  642. #          For example, to use msgpack:
  643. #          packer = 'msgpack.packb', unpacker='msgpack.unpackb'
  644. #      pack/unpack : callables
  645. #          You can also set the pack/unpack callables for serialization directly.
  646. #      session : bytes
  647. #          the ID of this Session object.  The default is to generate a new UUID.
  648. #      username : unicode
  649. #          username added to message headers.  The default is to ask the OS.
  650. #      key : bytes
  651. #          The key used to initialize an HMAC signature.  If unset, messages
  652. #          will not be signed or checked.
  653. #      keyfile : filepath
  654. #          The file containing a key.  If this is set, `key` will be initialized
  655. #          to the contents of the file.
  656. ## Threshold (in bytes) beyond which an object's buffer should be extracted to
  657. #  avoid pickling.
  658. #  Default: 1024
  659. # c.Session.buffer_threshold = 1024
  660. ## Whether to check PID to protect against calls after fork.
  661. #
  662. #          This check can be disabled if fork-safety is handled elsewhere.
  663. #  Default: True
  664. # c.Session.check_pid = True
  665. ## Threshold (in bytes) beyond which a buffer should be sent without copying.
  666. #  Default: 65536
  667. # c.Session.copy_threshold = 65536
  668. ## Debug output in the Session
  669. #  Default: False
  670. # c.Session.debug = False
  671. ## The maximum number of digests to remember.
  672. #
  673. #          The digest history will be culled when it exceeds this value.
  674. #  Default: 65536
  675. # c.Session.digest_history_size = 65536
  676. ## The maximum number of items for a container to be introspected for custom serialization.
  677. #          Containers larger than this are pickled outright.
  678. #  Default: 64
  679. # c.Session.item_threshold = 64
  680. ## execution key, for signing messages.
  681. #  Default: b''
  682. # c.Session.key = b''
  683. ## path to file containing execution key.
  684. #  Default: ''
  685. # c.Session.keyfile = ''
  686. ## Metadata dictionary, which serves as the default top-level metadata dict for
  687. #  each message.
  688. #  Default: {}
  689. # c.Session.metadata = {}
  690. ## The name of the packer for serializing messages.
  691. #              Should be one of 'json', 'pickle', or an import name
  692. #              for a custom callable serializer.
  693. #  Default: 'json'
  694. # c.Session.packer = 'json'
  695. ## The UUID identifying this session.
  696. #  Default: ''
  697. # c.Session.session = ''
  698. ## The digest scheme used to construct the message signatures.
  699. #          Must have the form 'hmac-HASH'.
  700. #  Default: 'hmac-sha256'
  701. # c.Session.signature_scheme = 'hmac-sha256'
  702. ## The name of the unpacker for unserializing messages.
  703. #          Only used with custom functions for `packer`.
  704. #  Default: 'json'
  705. # c.Session.unpacker = 'json'
  706. ## Username for the Session. Default is your system username.
  707. #  Default: 'username'
  708. # c.Session.username = 'username'
  709. #------------------------------------------------------------------------------
  710. # MultiKernelManager(LoggingConfigurable) configuration
  711. #------------------------------------------------------------------------------
  712. ## A class for managing multiple kernels.
  713. ## The name of the default kernel to start
  714. #  Default: 'python3'
  715. # c.MultiKernelManager.default_kernel_name = 'python3'
  716. ## The kernel manager class.  This is configurable to allow
  717. #          subclassing of the KernelManager for customized behavior.
  718. #  Default: 'jupyter_client.ioloop.IOLoopKernelManager'
  719. # c.MultiKernelManager.kernel_manager_class = 'jupyter_client.ioloop.IOLoopKernelManager'
  720. ## Share a single zmq.Context to talk to all my kernels
  721. #  Default: True
  722. # c.MultiKernelManager.shared_context = True
  723. #------------------------------------------------------------------------------
  724. # MappingKernelManager(MultiKernelManager) configuration
  725. #------------------------------------------------------------------------------
  726. ## A KernelManager that handles notebook mapping and HTTP error handling
  727. ## White list of allowed kernel message types.
  728. #          When the list is empty, all message types are allowed.
  729. #  Default: []
  730. # c.MappingKernelManager.allowed_message_types = []
  731. ## Whether messages from kernels whose frontends have disconnected should be buffered in-memory.
  732. #          When True (default), messages are buffered and replayed on reconnect,
  733. #          avoiding lost messages due to interrupted connectivity.
  734. #          Disable if long-running kernels will produce too much output while
  735. #          no frontends are connected.
  736. #  Default: True
  737. # c.MappingKernelManager.buffer_offline_messages = True
  738. ## Whether to consider culling kernels which are busy.
  739. #          Only effective if cull_idle_timeout > 0.
  740. #  Default: False
  741. # c.MappingKernelManager.cull_busy = False
  742. ## Whether to consider culling kernels which have one or more connections.
  743. #          Only effective if cull_idle_timeout > 0.
  744. #  Default: False
  745. # c.MappingKernelManager.cull_connected = False
  746. ## Timeout (in seconds) after which a kernel is considered idle and ready to be culled.
  747. #          Values of 0 or lower disable culling. Very short timeouts may result in kernels being culled
  748. #          for users with poor network connections.
  749. #  Default: 0
  750. # c.MappingKernelManager.cull_idle_timeout = 0
  751. ## The interval (in seconds) on which to check for idle kernels exceeding the
  752. #  cull timeout value.
  753. #  Default: 300
  754. # c.MappingKernelManager.cull_interval = 300
  755. ## The name of the default kernel to start
  756. #  See also: MultiKernelManager.default_kernel_name
  757. # c.MappingKernelManager.default_kernel_name = 'python3'
  758. ## Timeout for giving up on a kernel (in seconds).
  759. #          On starting and restarting kernels, we check whether the
  760. #          kernel is running and responsive by sending kernel_info_requests.
  761. #          This sets the timeout in seconds for how long the kernel can take
  762. #          before being presumed dead.
  763. #          This affects the MappingKernelManager (which handles kernel restarts)
  764. #          and the ZMQChannelsHandler (which handles the startup).
  765. #  Default: 60
  766. # c.MappingKernelManager.kernel_info_timeout = 60
  767. ## The kernel manager class.  This is configurable to allow
  768. #  See also: MultiKernelManager.kernel_manager_class
  769. # c.MappingKernelManager.kernel_manager_class = 'jupyter_client.ioloop.IOLoopKernelManager'
  770. #  Default: ''
  771. # c.MappingKernelManager.root_dir = ''
  772. ## Share a single zmq.Context to talk to all my kernels
  773. #  See also: MultiKernelManager.shared_context
  774. # c.MappingKernelManager.shared_context = True
  775. #------------------------------------------------------------------------------
  776. # KernelSpecManager(LoggingConfigurable) configuration
  777. #------------------------------------------------------------------------------
  778. ## List of allowed kernel names.
  779. #
  780. #          By default, all installed kernels are allowed.
  781. #  Default: set()
  782. # c.KernelSpecManager.allowed_kernelspecs = set()
  783. ## If there is no Python kernelspec registered and the IPython
  784. #          kernel is available, ensure it is added to the spec list.
  785. #  Default: True
  786. # c.KernelSpecManager.ensure_native_kernel = True
  787. ## The kernel spec class.  This is configurable to allow
  788. #          subclassing of the KernelSpecManager for customized behavior.
  789. #  Default: 'jupyter_client.kernelspec.KernelSpec'
  790. # c.KernelSpecManager.kernel_spec_class = 'jupyter_client.kernelspec.KernelSpec'
  791. ## Deprecated, use `KernelSpecManager.allowed_kernelspecs`
  792. #  Default: set()
  793. # c.KernelSpecManager.whitelist = set()
  794. #------------------------------------------------------------------------------
  795. # ContentsManager(LoggingConfigurable) configuration
  796. #------------------------------------------------------------------------------
  797. ## Base class for serving files and directories.
  798. #
  799. #      This serves any text or binary file,
  800. #      as well as directories,
  801. #      with special handling for JSON notebook documents.
  802. #
  803. #      Most APIs take a path argument,
  804. #      which is always an API-style unicode path,
  805. #      and always refers to a directory.
  806. #
  807. #      - unicode, not url-escaped
  808. #      - '/'-separated
  809. #      - leading and trailing '/' will be stripped
  810. #      - if unspecified, path defaults to '',
  811. #        indicating the root path.
  812. ## Allow access to hidden files
  813. #  Default: False
  814. # c.ContentsManager.allow_hidden = False
  815. #  Default: None
  816. # c.ContentsManager.checkpoints = None
  817. #  Default: 'notebook.services.contents.checkpoints.Checkpoints'
  818. # c.ContentsManager.checkpoints_class = 'notebook.services.contents.checkpoints.Checkpoints'
  819. #  Default: {}
  820. # c.ContentsManager.checkpoints_kwargs = {}
  821. ## handler class to use when serving raw file requests.
  822. #
  823. #          Default is a fallback that talks to the ContentsManager API,
  824. #          which may be inefficient, especially for large files.
  825. #
  826. #          Local files-based ContentsManagers can use a StaticFileHandler subclass,
  827. #          which will be much more efficient.
  828. #
  829. #          Access to these files should be Authenticated.
  830. #  Default: 'notebook.files.handlers.FilesHandler'
  831. # c.ContentsManager.files_handler_class = 'notebook.files.handlers.FilesHandler'
  832. ## Extra parameters to pass to files_handler_class.
  833. #
  834. #          For example, StaticFileHandlers generally expect a `path` argument
  835. #          specifying the root directory from which to serve files.
  836. #  Default: {}
  837. # c.ContentsManager.files_handler_params = {}
  838. ## Glob patterns to hide in file and directory listings.
  839. #  Default: ['__pycache__', '*.pyc', '*.pyo', '.DS_Store', '*.so', '*.dylib', '*~']
  840. # c.ContentsManager.hide_globs = ['__pycache__', '*.pyc', '*.pyo', '.DS_Store', '*.so', '*.dylib', '*~']
  841. ## Python callable or importstring thereof
  842. #
  843. #          To be called on a contents model prior to save.
  844. #
  845. #          This can be used to process the structure,
  846. #          such as removing notebook outputs or other side effects that
  847. #          should not be saved.
  848. #
  849. #          It will be called as (all arguments passed by keyword)::
  850. #
  851. #              hook(path=path, model=model, contents_manager=self)
  852. #
  853. #          - model: the model to be saved. Includes file contents.
  854. #            Modifying this dict will affect the file that is stored.
  855. #          - path: the API path of the save destination
  856. #          - contents_manager: this ContentsManager instance
  857. #  Default: None
  858. # c.ContentsManager.pre_save_hook = None
  859. #  Default: '/'
  860. # c.ContentsManager.root_dir = '/'
  861. ## The base name used when creating untitled directories.
  862. #  Default: 'Untitled Folder'
  863. # c.ContentsManager.untitled_directory = 'Untitled Folder'
  864. ## The base name used when creating untitled files.
  865. #  Default: 'untitled'
  866. # c.ContentsManager.untitled_file = 'untitled'
  867. ## The base name used when creating untitled notebooks.
  868. #  Default: 'Untitled'
  869. # c.ContentsManager.untitled_notebook = 'Untitled'
  870. #------------------------------------------------------------------------------
  871. # FileManagerMixin(Configurable) configuration
  872. #------------------------------------------------------------------------------
  873. ## Mixin for ContentsAPI classes that interact with the filesystem.
  874. #
  875. #  Provides facilities for reading, writing, and copying both notebooks and
  876. #  generic files.
  877. #
  878. #  Shared by FileContentsManager and FileCheckpoints.
  879. #
  880. #  Note ---- Classes using this mixin must provide the following attributes:
  881. #
  882. #  root_dir : unicode
  883. #      A directory against which API-style paths are to be resolved.
  884. #
  885. #  log : logging.Logger
  886. ## By default notebooks are saved on disk on a temporary file and then if successfully written, it replaces the old ones.
  887. #        This procedure, namely 'atomic_writing', causes some bugs on file system without operation order enforcement (like some networked fs).
  888. #        If set to False, the new notebook is written directly on the old one which could fail (eg: full filesystem or quota )
  889. #  Default: True
  890. # c.FileManagerMixin.use_atomic_writing = True
  891. #------------------------------------------------------------------------------
  892. # FileContentsManager(FileManagerMixin, ContentsManager) configuration
  893. #------------------------------------------------------------------------------
  894. ## Allow access to hidden files
  895. #  See also: ContentsManager.allow_hidden
  896. # c.FileContentsManager.allow_hidden = False
  897. #  See also: ContentsManager.checkpoints
  898. # c.FileContentsManager.checkpoints = None
  899. #  See also: ContentsManager.checkpoints_class
  900. # c.FileContentsManager.checkpoints_class = 'notebook.services.contents.checkpoints.Checkpoints'
  901. #  See also: ContentsManager.checkpoints_kwargs
  902. # c.FileContentsManager.checkpoints_kwargs = {}
  903. ## If True (default), deleting files will send them to the
  904. #          platform's trash/recycle bin, where they can be recovered. If False,
  905. #          deleting files really deletes them.
  906. #  Default: True
  907. # c.FileContentsManager.delete_to_trash = True
  908. ## handler class to use when serving raw file requests.
  909. #  See also: ContentsManager.files_handler_class
  910. # c.FileContentsManager.files_handler_class = 'notebook.files.handlers.FilesHandler'
  911. ## Extra parameters to pass to files_handler_class.
  912. #  See also: ContentsManager.files_handler_params
  913. # c.FileContentsManager.files_handler_params = {}
  914. ##
  915. #  See also: ContentsManager.hide_globs
  916. # c.FileContentsManager.hide_globs = ['__pycache__', '*.pyc', '*.pyo', '.DS_Store', '*.so', '*.dylib', '*~']
  917. ## Python callable or importstring thereof
  918. #
  919. #          to be called on the path of a file just saved.
  920. #
  921. #          This can be used to process the file on disk,
  922. #          such as converting the notebook to a script or HTML via nbconvert.
  923. #
  924. #          It will be called as (all arguments passed by keyword)::
  925. #
  926. #              hook(os_path=os_path, model=model, contents_manager=instance)
  927. #
  928. #          - path: the filesystem path to the file just written
  929. #          - model: the model representing the file
  930. #          - contents_manager: this ContentsManager instance
  931. #  Default: None
  932. # c.FileContentsManager.post_save_hook = None
  933. ## Python callable or importstring thereof
  934. #  See also: ContentsManager.pre_save_hook
  935. # c.FileContentsManager.pre_save_hook = None
  936. #  Default: ''
  937. # c.FileContentsManager.root_dir = ''
  938. ## DEPRECATED, use post_save_hook. Will be removed in Notebook 5.0
  939. #  Default: False
  940. # c.FileContentsManager.save_script = False
  941. ## The base name used when creating untitled directories.
  942. #  See also: ContentsManager.untitled_directory
  943. # c.FileContentsManager.untitled_directory = 'Untitled Folder'
  944. ## The base name used when creating untitled files.
  945. #  See also: ContentsManager.untitled_file
  946. # c.FileContentsManager.untitled_file = 'untitled'
  947. ## The base name used when creating untitled notebooks.
  948. #  See also: ContentsManager.untitled_notebook
  949. # c.FileContentsManager.untitled_notebook = 'Untitled'
  950. ## By default notebooks are saved on disk on a temporary file and then if
  951. #  successfully written, it replaces the old ones.
  952. #  See also: FileManagerMixin.use_atomic_writing
  953. # c.FileContentsManager.use_atomic_writing = True
  954. #------------------------------------------------------------------------------
  955. # NotebookNotary(LoggingConfigurable) configuration
  956. #------------------------------------------------------------------------------
  957. ## A class for computing and verifying notebook signatures.
  958. ## The hashing algorithm used to sign notebooks.
  959. #  Choices: any of ['sha512', 'sha384', 'sha3_512', 'sha3_256', 'md5', 'sha224', 'blake2s', 'sha1', 'sha3_224', 'sha256', 'blake2b', 'sha3_384']
  960. #  Default: 'sha256'
  961. # c.NotebookNotary.algorithm = 'sha256'
  962. ## The storage directory for notary secret and database.
  963. #  Default: ''
  964. # c.NotebookNotary.data_dir = ''
  965. ## The sqlite file in which to store notebook signatures.
  966. #          By default, this will be in your Jupyter data directory.
  967. #          You can set it to ':memory:' to disable sqlite writing to the filesystem.
  968. #  Default: ''
  969. # c.NotebookNotary.db_file = ''
  970. ## The secret key with which notebooks are signed.
  971. #  Default: b''
  972. # c.NotebookNotary.secret = b''
  973. ## The file where the secret key is stored.
  974. #  Default: ''
  975. # c.NotebookNotary.secret_file = ''
  976. ## A callable returning the storage backend for notebook signatures.
  977. #           The default uses an SQLite database.
  978. #  Default: traitlets.Undefined
  979. # c.NotebookNotary.store_factory = traitlets.Undefined
  980. #------------------------------------------------------------------------------
  981. # AsyncMultiKernelManager(MultiKernelManager) configuration
  982. #------------------------------------------------------------------------------
  983. ## The name of the default kernel to start
  984. #  See also: MultiKernelManager.default_kernel_name
  985. # c.AsyncMultiKernelManager.default_kernel_name = 'python3'
  986. ## The kernel manager class.  This is configurable to allow
  987. #          subclassing of the AsyncKernelManager for customized behavior.
  988. #  Default: 'jupyter_client.ioloop.AsyncIOLoopKernelManager'
  989. # c.AsyncMultiKernelManager.kernel_manager_class = 'jupyter_client.ioloop.AsyncIOLoopKernelManager'
  990. ## Share a single zmq.Context to talk to all my kernels
  991. #  See also: MultiKernelManager.shared_context
  992. # c.AsyncMultiKernelManager.shared_context = True
  993. ## Whether to make kernels available before the process has started.  The
  994. #          kernel has a `.ready` future which can be awaited before connecting
  995. #  Default: False
  996. # c.AsyncMultiKernelManager.use_pending_kernels = False
  997. #------------------------------------------------------------------------------
  998. # AsyncMappingKernelManager(MappingKernelManager, AsyncMultiKernelManager) configuration
  999. #------------------------------------------------------------------------------
  1000. ## White list of allowed kernel message types.
  1001. #  See also: MappingKernelManager.allowed_message_types
  1002. # c.AsyncMappingKernelManager.allowed_message_types = []
  1003. ## Whether messages from kernels whose frontends have disconnected should be
  1004. #  buffered in-memory.
  1005. #  See also: MappingKernelManager.buffer_offline_messages
  1006. # c.AsyncMappingKernelManager.buffer_offline_messages = True
  1007. ## Whether to consider culling kernels which are busy.
  1008. #  See also: MappingKernelManager.cull_busy
  1009. # c.AsyncMappingKernelManager.cull_busy = False
  1010. ## Whether to consider culling kernels which have one or more connections.
  1011. #  See also: MappingKernelManager.cull_connected
  1012. # c.AsyncMappingKernelManager.cull_connected = False
  1013. ## Timeout (in seconds) after which a kernel is considered idle and ready to be
  1014. #  culled.
  1015. #  See also: MappingKernelManager.cull_idle_timeout
  1016. # c.AsyncMappingKernelManager.cull_idle_timeout = 0
  1017. ## The interval (in seconds) on which to check for idle kernels exceeding the
  1018. #  cull timeout value.
  1019. #  See also: MappingKernelManager.cull_interval
  1020. # c.AsyncMappingKernelManager.cull_interval = 300
  1021. ## The name of the default kernel to start
  1022. #  See also: MultiKernelManager.default_kernel_name
  1023. # c.AsyncMappingKernelManager.default_kernel_name = 'python3'
  1024. ## Timeout for giving up on a kernel (in seconds).
  1025. #  See also: MappingKernelManager.kernel_info_timeout
  1026. # c.AsyncMappingKernelManager.kernel_info_timeout = 60
  1027. ## The kernel manager class.  This is configurable to allow
  1028. #  See also: AsyncMultiKernelManager.kernel_manager_class
  1029. # c.AsyncMappingKernelManager.kernel_manager_class = 'jupyter_client.ioloop.AsyncIOLoopKernelManager'
  1030. #  See also: MappingKernelManager.root_dir
  1031. # c.AsyncMappingKernelManager.root_dir = ''
  1032. ## Share a single zmq.Context to talk to all my kernels
  1033. #  See also: MultiKernelManager.shared_context
  1034. # c.AsyncMappingKernelManager.shared_context = True
  1035. ## Whether to make kernels available before the process has started.  The
  1036. #  See also: AsyncMultiKernelManager.use_pending_kernels
  1037. # c.AsyncMappingKernelManager.use_pending_kernels = False
  1038. #------------------------------------------------------------------------------
  1039. # GatewayKernelManager(AsyncMappingKernelManager) configuration
  1040. #------------------------------------------------------------------------------
  1041. ## Kernel manager that supports remote kernels hosted by Jupyter Kernel or
  1042. #  Enterprise Gateway.
  1043. ## White list of allowed kernel message types.
  1044. #  See also: MappingKernelManager.allowed_message_types
  1045. # c.GatewayKernelManager.allowed_message_types = []
  1046. ## Whether messages from kernels whose frontends have disconnected should be
  1047. #  buffered in-memory.
  1048. #  See also: MappingKernelManager.buffer_offline_messages
  1049. # c.GatewayKernelManager.buffer_offline_messages = True
  1050. ## Whether to consider culling kernels which are busy.
  1051. #  See also: MappingKernelManager.cull_busy
  1052. # c.GatewayKernelManager.cull_busy = False
  1053. ## Whether to consider culling kernels which have one or more connections.
  1054. #  See also: MappingKernelManager.cull_connected
  1055. # c.GatewayKernelManager.cull_connected = False
  1056. ## Timeout (in seconds) after which a kernel is considered idle and ready to be
  1057. #  culled.
  1058. #  See also: MappingKernelManager.cull_idle_timeout
  1059. # c.GatewayKernelManager.cull_idle_timeout = 0
  1060. ## The interval (in seconds) on which to check for idle kernels exceeding the
  1061. #  cull timeout value.
  1062. #  See also: MappingKernelManager.cull_interval
  1063. # c.GatewayKernelManager.cull_interval = 300
  1064. ## The name of the default kernel to start
  1065. #  See also: MultiKernelManager.default_kernel_name
  1066. # c.GatewayKernelManager.default_kernel_name = 'python3'
  1067. ## Timeout for giving up on a kernel (in seconds).
  1068. #  See also: MappingKernelManager.kernel_info_timeout
  1069. # c.GatewayKernelManager.kernel_info_timeout = 60
  1070. ## The kernel manager class.  This is configurable to allow
  1071. #  See also: AsyncMultiKernelManager.kernel_manager_class
  1072. # c.GatewayKernelManager.kernel_manager_class = 'jupyter_client.ioloop.AsyncIOLoopKernelManager'
  1073. #  See also: MappingKernelManager.root_dir
  1074. # c.GatewayKernelManager.root_dir = ''
  1075. ## Share a single zmq.Context to talk to all my kernels
  1076. #  See also: MultiKernelManager.shared_context
  1077. # c.GatewayKernelManager.shared_context = True
  1078. ## Whether to make kernels available before the process has started.  The
  1079. #  See also: AsyncMultiKernelManager.use_pending_kernels
  1080. # c.GatewayKernelManager.use_pending_kernels = False
  1081. #------------------------------------------------------------------------------
  1082. # GatewayKernelSpecManager(KernelSpecManager) configuration
  1083. #------------------------------------------------------------------------------
  1084. ## List of allowed kernel names.
  1085. #  See also: KernelSpecManager.allowed_kernelspecs
  1086. # c.GatewayKernelSpecManager.allowed_kernelspecs = set()
  1087. ## If there is no Python kernelspec registered and the IPython
  1088. #  See also: KernelSpecManager.ensure_native_kernel
  1089. # c.GatewayKernelSpecManager.ensure_native_kernel = True
  1090. ## The kernel spec class.  This is configurable to allow
  1091. #  See also: KernelSpecManager.kernel_spec_class
  1092. # c.GatewayKernelSpecManager.kernel_spec_class = 'jupyter_client.kernelspec.KernelSpec'
  1093. ## Deprecated, use `KernelSpecManager.allowed_kernelspecs`
  1094. #  See also: KernelSpecManager.whitelist
  1095. # c.GatewayKernelSpecManager.whitelist = set()
  1096. #------------------------------------------------------------------------------
  1097. # GatewayClient(SingletonConfigurable) configuration
  1098. #------------------------------------------------------------------------------
  1099. ## This class manages the configuration.  It's its own singleton class so that we
  1100. #         can share these values across all objects.  It also contains some helper methods
  1101. #         to build request arguments out of the various config options.
  1102. ## The authorization token used in the HTTP headers.  (JUPYTER_GATEWAY_AUTH_TOKEN
  1103. #  env var)
  1104. #  Default: None
  1105. # c.GatewayClient.auth_token = None
  1106. ## The filename of CA certificates or None to use defaults.
  1107. #  (JUPYTER_GATEWAY_CA_CERTS env var)
  1108. #  Default: None
  1109. # c.GatewayClient.ca_certs = None
  1110. ## The filename for client SSL certificate, if any.  (JUPYTER_GATEWAY_CLIENT_CERT
  1111. #  env var)
  1112. #  Default: None
  1113. # c.GatewayClient.client_cert = None
  1114. ## The filename for client SSL key, if any.  (JUPYTER_GATEWAY_CLIENT_KEY env var)
  1115. #  Default: None
  1116. # c.GatewayClient.client_key = None
  1117. ## The time allowed for HTTP connection establishment with the Gateway server.
  1118. #          (JUPYTER_GATEWAY_CONNECT_TIMEOUT env var)
  1119. #  Default: 40.0
  1120. # c.GatewayClient.connect_timeout = 40.0
  1121. ## A comma-separated list of environment variable names that will be included, along with
  1122. #           their values, in the kernel startup request.  The corresponding `env_whitelist` configuration
  1123. #           value must also be set on the Gateway server - since that configuration value indicates which
  1124. #           environmental values to make available to the kernel. (JUPYTER_GATEWAY_ENV_WHITELIST env var)
  1125. #  Default: ''
  1126. # c.GatewayClient.env_whitelist = ''
  1127. ## The time allowed for HTTP reconnection with the Gateway server for the first time.
  1128. #                  Next will be JUPYTER_GATEWAY_RETRY_INTERVAL multiplied by two in factor of numbers of retries
  1129. #                  but less than JUPYTER_GATEWAY_RETRY_INTERVAL_MAX.
  1130. #                  (JUPYTER_GATEWAY_RETRY_INTERVAL env var)
  1131. #  Default: 1.0
  1132. # c.GatewayClient.gateway_retry_interval = 1.0
  1133. ## The maximum time allowed for HTTP reconnection retry with the Gateway server.
  1134. #                  (JUPYTER_GATEWAY_RETRY_INTERVAL_MAX env var)
  1135. #  Default: 30.0
  1136. # c.GatewayClient.gateway_retry_interval_max = 30.0
  1137. ## The maximum retries allowed for HTTP reconnection with the Gateway server.
  1138. #                  (JUPYTER_GATEWAY_RETRY_MAX env var)
  1139. #  Default: 5
  1140. # c.GatewayClient.gateway_retry_max = 5
  1141. ## Additional HTTP headers to pass on the request.  This value will be converted to a dict.
  1142. #            (JUPYTER_GATEWAY_HEADERS env var)
  1143. #  Default: '{}'
  1144. # c.GatewayClient.headers = '{}'
  1145. ## The password for HTTP authentication.  (JUPYTER_GATEWAY_HTTP_PWD env var)
  1146. #  Default: None
  1147. # c.GatewayClient.http_pwd = None
  1148. ## The username for HTTP authentication. (JUPYTER_GATEWAY_HTTP_USER env var)
  1149. #  Default: None
  1150. # c.GatewayClient.http_user = None
  1151. ## The gateway API endpoint for accessing kernel resources
  1152. #  (JUPYTER_GATEWAY_KERNELS_ENDPOINT env var)
  1153. #  Default: '/api/kernels'
  1154. # c.GatewayClient.kernels_endpoint = '/api/kernels'
  1155. ## The gateway API endpoint for accessing kernelspecs
  1156. #  (JUPYTER_GATEWAY_KERNELSPECS_ENDPOINT env var)
  1157. #  Default: '/api/kernelspecs'
  1158. # c.GatewayClient.kernelspecs_endpoint = '/api/kernelspecs'
  1159. ## The gateway endpoint for accessing kernelspecs resources
  1160. #              (JUPYTER_GATEWAY_KERNELSPECS_RESOURCE_ENDPOINT env var)
  1161. #  Default: '/kernelspecs'
  1162. # c.GatewayClient.kernelspecs_resource_endpoint = '/kernelspecs'
  1163. ## The time allowed for HTTP request completion. (JUPYTER_GATEWAY_REQUEST_TIMEOUT
  1164. #  env var)
  1165. #  Default: 40.0
  1166. # c.GatewayClient.request_timeout = 40.0
  1167. ## The url of the Kernel or Enterprise Gateway server where
  1168. #          kernel specifications are defined and kernel management takes place.
  1169. #          If defined, this Notebook server acts as a proxy for all kernel
  1170. #          management and kernel specification retrieval.  (JUPYTER_GATEWAY_URL env var)
  1171. #  Default: None
  1172. # c.GatewayClient.url = None
  1173. ## For HTTPS requests, determines if server's certificate should be validated or not.
  1174. #          (JUPYTER_GATEWAY_VALIDATE_CERT env var)
  1175. #  Default: True
  1176. # c.GatewayClient.validate_cert = True
  1177. ## The websocket url of the Kernel or Enterprise Gateway server.  If not provided, this value
  1178. #          will correspond to the value of the Gateway url with 'ws' in place of 'http'.  (JUPYTER_GATEWAY_WS_URL env var)
  1179. #  Default: None
  1180. # c.GatewayClient.ws_url = None
  1181. #------------------------------------------------------------------------------
  1182. # TerminalManager(LoggingConfigurable) configuration
  1183. #------------------------------------------------------------------------------
  1184. ##
  1185. ## Timeout (in seconds) in which a terminal has been inactive and ready to be culled.
  1186. #          Values of 0 or lower disable culling.
  1187. #  Default: 0
  1188. # c.TerminalManager.cull_inactive_timeout = 0
  1189. ## The interval (in seconds) on which to check for terminals exceeding the
  1190. #  inactive timeout value.
  1191. #  Default: 300
  1192. # c.TerminalManager.cull_interval = 300
复制代码
来源:https://www.cnblogs.com/yourxiong/p/17692123.html
免责声明:由于采集信息均来自互联网,如果侵犯了您的权益,请联系我们【E-Mail:cb@itdo.tech】 我们会及时删除侵权内容,谢谢合作!

举报 回复 使用道具