IPython notebook 不会读取配置文件 [英] IPython notebook won't read the configuration file

查看:36
本文介绍了IPython notebook 不会读取配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下命令来初始化配置文件:

I used the following command to initialize a profile:

ipython profile create myserver

将这些行添加到 ~/.ipython/profile_myserver/ipython_notebook_config.py:

c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.port = 8889

尝试通过以下方式启动笔记本:

Tried starting the notebook with:

ipython notebook --profile=myserver --debug

它根本不读取配置文件.这是日志输出:

It does not read the config file at all. This is the log output:

[W 16:26:56.607 NotebookApp] Unrecognized alias: '--profile=myserver', it will probably have no effect.
[D 16:26:56.609 NotebookApp] Config changed:
[D 16:26:56.609 NotebookApp] {'profile': u'myserver', 'NotebookApp': {'log_level': 10}}
...
[I 16:26:56.665 NotebookApp] 0 active kernels 
[I 16:26:56.665 NotebookApp] The IPython Notebook is running at: http://localhost:8888/

因为我已经明确指定了端口 8889 并且它仍然在 8888 上运行,所以它显然忽略了配置文件.我错过了什么?

Since I've explicitly specified port 8889 and it still runs on 8888, it clearly ignores the config file. What am I missing?

推荐答案

IPython 现已移至 version 4.0,这意味着如果您正在使用它,它将从 ~/.jupyter 读取其配置,不是 ~/.ipython.您必须使用

IPython has now moved to version 4.0, which means that if you are using it, it will be reading its configuration from ~/.jupyter, not ~/.ipython. You have to create a new configuration file with

jupyter notebook --generate-config

然后根据需要编辑生成的 ~/.jupyter/jupyter_notebook_config.py 文件.

and then edit the resulting ~/.jupyter/jupyter_notebook_config.py file according to your needs.

更多安装说明此处.

这篇关于IPython notebook 不会读取配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆