70

I've been trying to setup an ipython server following several tutorials (since none was exactly my case). A couple days ago, I did manage to get it to the point where it was launching but then was not able to access it via url. Today it's not launching anymore and I can't find much about this specific error I get:

Traceback (most recent call last):
  File "/usr/local/bin/ipython", line 9, in <module>
    load_entry_point('ipython==4.0.0-dev', 'console_scripts', 'ipython')()
  File "/usr/local/lib/python2.7/dist-packages/ipython-4.0.0_dev-py2.7.egg/IPython/__init__.py", line 118, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/traitlets-4.0.0-py2.7.egg/traitlets/config/application.py", line 591, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "/usr/local/lib/python2.7/dist-packages/traitlets-4.0.0-py2.7.egg/traitlets/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/ipython-4.0.0_dev-py2.7.egg/IPython/terminal/ipapp.py", line 302, in initialize
    super(TerminalIPythonApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "/usr/local/lib/python2.7/dist-packages/traitlets-4.0.0-py2.7.egg/traitlets/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/ipython-4.0.0_dev-py2.7.egg/IPython/core/application.py", line 386, in initialize
    self.parse_command_line(argv)
  File "/usr/local/lib/python2.7/dist-packages/ipython-4.0.0_dev-py2.7.egg/IPython/terminal/ipapp.py", line 297, in parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)
  File "<string>", line 2, in parse_command_line
  File "/usr/local/lib/python2.7/dist-packages/traitlets-4.0.0-py2.7.egg/traitlets/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/traitlets-4.0.0-py2.7.egg/traitlets/config/application.py", line 487, in parse_command_line
    return self.initialize_subcommand(subc, subargv)
  File "<string>", line 2, in initialize_subcommand
  File "/usr/local/lib/python2.7/dist-packages/traitlets-4.0.0-py2.7.egg/traitlets/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/traitlets-4.0.0-py2.7.egg/traitlets/config/application.py", line 418, in initialize_subcommand
    subapp = import_item(subapp)
  File "build/bdist.linux-x86_64/egg/ipython_genutils/importstring.py", line 31, in import_item
ImportError: No module named notebook.notebookapp

So about the setup, I have installed the anaconda distrib of ipython, pyzmq & tornado libraries. I have created a profile nbserver and the config file is as follows - ipython.config.py:

c = get_config()
c.IPKernalApp.pylab = 'inline'
c.NotebookApp.certfile = u'/home/ludo/.ipython/profile_nbserver/mycert.pem'
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.password = u'sha1:e6cb2aa9a[...]'
c.NotebookApp.port = 9999
c.NotebookManager.notebook_dir = u'/var/www/ipynb/'
c.NotebookApp.base_project_url = '/ipynb/'
c.NotebookApp.base_kernel_url = '/ipynb/'
c.NotebookApp.webapp_settings = {'static_url_prefix':'/ipynb/static/'}

I really don't know where to look for clues anymore - and I'm probably lacking a greater understanding of how all this works to figure it out. My ultimate goal is to then use the answer to this question on SO to complete a setup behind apache and eventually connect it to colaboratory - but seems like it should launch first.

Many thanks for any help :)

Community
  • 1
  • 1
LudoC
  • 919
  • 1
  • 8
  • 16
  • I'm voting to close this question as off-topic because the user is requesting help to install a developement version of a software, while it should stick to stable version. – Matt Jul 14 '15 at 04:24
  • Please select @AndySmith's [answer](http://stackoverflow.com/a/32166022/210945), so it floats to the top, as it is more correct. – naught101 Aug 25 '15 at 00:14

5 Answers5

168

This should fix the issue:

pip install jupyter
spongebob
  • 8,370
  • 15
  • 50
  • 83
Andy Smith
  • 3,308
  • 4
  • 26
  • 34
  • 1
    aaah! this is AWESOME! thanks a lot, i could've lost hours without ur answer – DenisFLASH Sep 10 '15 at 05:37
  • If you use Anaconda: launch Anaconda prompt as admin (if you're on Windows), then `conda update conda && conda update ipython && conda install jupyter`. – gaborous Nov 30 '15 at 22:09
  • jupyter is more and more the tool to use when you want to work with notebooks via ipython. See http://ipython.org for the long story. – FredrikHedman Jul 05 '16 at 14:03
  • I am trying to `pip install jupyter`, but i get this error: `No distributions at all found for entrypoints (from nbconvert->jupyter)` – Maksim Gayduk Oct 06 '16 at 10:01
20

I received the same problem when upgrading IPython. At the moment the answer was written, it was a bug linked to the latest 4 version. If a similar problem occurs for which you wish to switch back to the stable version 3.2.1:

pip uninstall -y IPython
pip install ipython==3.2.1
Community
  • 1
  • 1
meduz
  • 3,903
  • 1
  • 28
  • 40
  • Hi Meduz, yes, I followed a tutorial blindly and didn't realise I installed a dev version via git... strange for Microsoft to suggest this install to make your DS environment... Anyhow, I uninstalled, modified my shell path to be able to use the anaconda instance (which I had also installed), opened my port on my firewall conf file and finally managed to get all this up & running... phew! After all, it's by screwing up that you really learn :) – LudoC Jul 16 '15 at 06:50
  • 5
    For clarification, I was able to get this to work for what I wanted when I did: `pip install ipython[notebook]==3.2.1` – Dave C Jul 20 '15 at 19:42
  • 4
    -1: this isn't a bug in iPython per se; it's simply that it doesn't force you to install the dependencies for the `notebook` command (and the exact same thing happens in 3.2, just with a slightly more informative error message). The above comment has the correct solution. – Ben Kuhn Aug 13 '15 at 17:24
  • 1
    To expand on @DaveC and @Ben's point, simply running `pip install ipython[notebook]` solves the issue using the latest version of ipython notebook. – Dolan Antenucci Aug 13 '15 at 21:30
  • I updated the wording to reflect that this "bug" was fixed until the point the question was asked - and by the way, note that now jupyter is here, see http://blog.jupyter.org/2015/08/12/first-release-of-jupyter/ – meduz Aug 14 '15 at 07:44
  • Given that @AndySmith's answer is generally more applicable and correct from now on, you should probably make it explicit that this isn't the recommended solution for the general problem, or just delete this answer. – naught101 Aug 25 '15 at 00:15
  • This is not a big, the issue is still present with the stable version, but it's only logical because IPython is now a wrapper for Jupyter for Python, so you now need to install both. – gaborous Nov 30 '15 at 22:10
4

So to close this thread, and in case it helps anyone, my mistake was to have installed and used the dev version of ipython blindly following a tutorial, thinking I was using the anaconda instance I installed earlier (which was not even in my PATH).

Anyhow I:

  • uninstalled that ipython dev instance
  • added anaconda/bin to my zsh path (add it to ~/.zshrc - that's why it was not even in my path after install) // at this point the server was launching fine but I couldn't access it in my browser >> firewall problems.
  • opened my port of choice in my firewall (help for linode or ubuntu in general)

And everything works fine now.

LudoC
  • 919
  • 1
  • 8
  • 16
3

Someone mentioned this in a comment, and it (almost) worked for me:

pip install ipython[notebook]

pip gave an error about the hash not matching. However, what ultimately worked was:

sudo port install py27-notebook

And for py3:

sudo port install py35-notebook
reubano
  • 5,087
  • 1
  • 42
  • 41
0

You should not try to install from github master branch if you do not now what you are doing. Remove what you have installed and stick to stable version.

If you want to work on developpement version, ask on the developpement mailing-list. Some knowlege on how to debug this will probably be required.

Matt
  • 27,170
  • 6
  • 80
  • 74
  • quite right @Matt, did not notice I was installing a dev version following this [tutorial](http://blogs.msdn.com/b/hpctrekker/archive/2013/04/09/data-science-in-a-box-using-ipython-installing-ipython-notebook-2-4.aspx)... I will uninstall that and try again cleanly, thanks. – LudoC Jul 14 '15 at 04:42