IPython notebook won't read the configuration

2019-01-18 10:45发布

I used the following command to initialize a profile:

ipython profile create myserver

Added thses lines to ~/.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/

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

2条回答
Animai°情兽
2楼-- · 2019-01-18 11:31

Instead of using the ipython command, use jupyter:

jupyter notebook --profile=myserver

With the release of IPython 4.0, the language-agnostic pieces of IPython, such as the notebook server, were moved to Jupyter. You can read more about The Big Split and the new release of Jupyter at those links.

查看更多
时光不老,我们不散
3楼-- · 2019-01-18 11:42

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

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

More installation instructions here.

查看更多
登录 后发表回答