如何从Jupyter 4.x获取IPython配置文件行为?

2024-04-25 13:09:43 发布

您现在位置:Python中文网/ 问答频道 /正文

有官员吗建议运行IPython笔记本服务器,并通过

$ ipython profile create nbserver

按照http://ipython.org/ipython-doc/1/interactive/public_server.html中的建议。这允许在通过ipython notebookipython notebook --profile=nbserver启动IPython笔记本时有非常不同和非常有用的行为。

在Jupyter 4.0中,有一个变化,不再有配置文件。我找到了用户minrk说的对话https://gitter.im/ipython/ipython/archives/2015/05/29

The .ipython directory has several things in it:

multiple config directories (called profiles)

one 'data' directory, containing things like kernelspecs, nbextensions

runtime info scattered throughout, but mostly in profiles

Jupyter follows more platform-appropriate conventions:

one config dir at JUPYTER_CONFIG_DIR, default: .jupyter

one data dir at JUPYTER_DATA_DIR, default: platform-specific

one runtime dir at JUPYTER_RUNTIME_DIR, default: platform-specific

还有一句相当隐晦的话:

If you want to use different config, specify a different config directory with JUPYTER_CONFIG_DIR=whatever

获得不同行为的最佳方法是什么(例如,在作为服务器运行时与正常使用时之间)?

是否需要运行类似于:

$ export JUPYTER_CONFIG_DIR=~/.jupyter-nbserver
$ jupyter notebook

何时需要运行服务器“配置文件”?以及

$ export JUPYTER_CONFIG_DIR=~/.jupyter
$ jupyter notebook

何时需要运行“正常”配置文件?因为那看起来很可怕。在Jupyter 4.0中,最好的方法是什么?


Tags: 服务器config配置文件diripythonjupyteronedirectory