16

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?

CentAu
  • 10,660
  • 15
  • 59
  • 85
  • Which version are you using? – Cyphase Aug 12 '15 at 20:42
  • IPython 4.0.0. python 2.7.9. @Cyphase – CentAu Aug 12 '15 at 20:46
  • 1
    Try `ipython --profile=myserver notebook --debug`. If it works, I'll post an answer. – Cyphase Aug 12 '15 at 20:48
  • It terminates with following messages. ``[TerminalIPythonApp] Loading IPython extension: storemagic [TerminalIPythonApp] WARNING | File not found: u'notebook' [TerminalIPythonApp] IPython not interactive...`` – CentAu Aug 12 '15 at 20:49
  • Using your original command line, try putting the configuration in `~/.ipython/profile_myserver/ipython_config.py` instead of `~/.ipython/profile_myserver/ipython_notebook_config.py`. – Cyphase Aug 12 '15 at 20:50
  • Already put the config in both those files. Doesn't change anything. – CentAu Aug 12 '15 at 20:52
  • Try setting the IP to `'localhost'` instead of `'*'`. Just in case. Make sure one file isn't messing with the other. – Cyphase Aug 12 '15 at 20:53
  • It still doesn't work. From log I can see that it reads the config. But it complains about this: ``[TerminalIPythonApp] WARNING | File not found: u'notebook' [TerminalIPythonApp] IPython not interactive...`` – CentAu Aug 12 '15 at 20:54
  • Wait, isn't that the error you got from trying the command I gave? I meant for you to go back to using the one in your question :). – Cyphase Aug 12 '15 at 20:55
  • I see! I'm using this: ``ipython notebook --profile=myserver --debug`` Still the same problem. Runs on 8888. Doesn't read the config. And both config files are the same – CentAu Aug 12 '15 at 20:58
  • Have you confirmed that it is actually running on port 8888 and not 8889? It's highly unlikely that it would be inconsistent in that way, but I would check to get that out of the way :P. – Cyphase Aug 12 '15 at 21:00
  • Just checked. It is not running on 8889. I also tried it on IPython 3.1.0 and everything worked fine. What's wrong with 4.0.0? – CentAu Aug 12 '15 at 21:03
  • Perhaps this has to do with the Jupyter re-org. Try using `jupyter` instead of `ipython` to start the notebook. – Cyphase Aug 12 '15 at 21:10
  • 1
    That was the problem! Configuring the jupyter instead of ipython and starting it with ``jupyther notebook --profile=myserver`` solved the problem. Thanks! Please feel free to add the answer :) – CentAu Aug 12 '15 at 21:15
  • 1
    Done. Also, I added the 'jupyter' tag to your post, but you could just do it yourself, as my edit needs to be approved. That'll make it easier for people to find. I expect others will be running into this over the next few days and beyond, as the new versions were just released. – Cyphase Aug 12 '15 at 21:31

2 Answers2

29

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.

dmvianna
  • 15,088
  • 18
  • 77
  • 106
  • What happens to all the profile folders that are in `~/.ipython`? Are they ignored? Do I need to copy them over to `~/.jupyter`? – orome Aug 17 '15 at 22:34
  • 1
    @raxacoricofallapatorius, I wouldn't just copy them across, as the API changed a little. The best thing is to edit the new config manually, copying accross whatever settings you had in the old one and reading the comments in the new one to understand the API changes. Yes, they are ignored (AFAIK). – dmvianna Aug 17 '15 at 22:38
  • That makes sense. Not everything needs to be moved/recreated though, right? It seems like the some things (e.g.`ipython_config.py`) are still used (at least outside of notebooks). It's not clear to me where `ipython` gets reads its configuration vs. where `ipython notebook` does (or for that matter, what happens with other kernels). – orome Aug 17 '15 at 22:43
  • @raxacoricofallapatorius, you really have to read the [installation instructions for Jupyter](https://jupyter.readthedocs.org/en/latest/config.html). I didn't try it, but it seems to me that for the console application you should run `jupyter console --generate config`. For kernels I believe the process hasn't changed. I didn't do anything to them, but they work for me, so maybe it is still reading from `~/.ipython` after all. – dmvianna Aug 17 '15 at 22:50
  • This section in the docs was helpful: [Migrating from IPython](http://jupyter.readthedocs.org/en/latest/migrating.html#migrating) The IPython configuration I was using for a notebook server needed no changes. After `jupyter notebook`: `The IPython Notebook is running at: https://10.0.1.207:10000/` – dmmfll Sep 29 '15 at 20:16
2

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.

Cyphase
  • 11,502
  • 2
  • 31
  • 32
  • 2
    jupyter actually no longer has profiles either, see here: https://github.com/jupyter/notebook/pull/310 – Kevin Dahl Aug 18 '15 at 05:29
  • @KevinDahl, hmm, then I wonder what OP meant that it solved the problem.. I'm not familiar enough with it to know. – Cyphase Aug 18 '15 at 05:42