1
votes

When I start an ipython notebook as follows:

C:\Python27\python.exe "C:\Python27\scripts\ipython-script.py" notebook

I get the following errors:

2014-07-24 14:22:24.584 [NotebookApp] Using existing profile dir: u'C:\\Users\\psmith\\.ipython\\profile_default'
2014-07-24 14:22:24.595 [NotebookApp] Using MathJax from CDN: http://cdn.mathjax.org/mathjax/latest/MathJax.js
2014-07-24 14:22:24.618 [NotebookApp] Serving notebooks from local directory: C:\Users\loshea\TFS\Research
2014-07-24 14:22:24.618 [NotebookApp] 0 active kernels
2014-07-24 14:22:24.618 [NotebookApp] The IPython Notebook is running at: http://localhost:8888/
2014-07-24 14:22:24.618 [NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
ERROR:root:Exception in I/O handler for fd 648
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\pyzmq-2.2.0.1-py2.7-win-amd64.egg\zmq\eventloop\ioloop.py", line 346, in start
    self._handlers[fd](fd, events)
KeyError: 648L

and the error is then repeated endlessly. My config is (python from python.org and all packages from Christoph Gohlke's site):

  • Python 2.7.8 (64-bit)
  • ipython-2.1.0
  • pyzmq-14.3.1
  • certifi-14.05.14
  • backports.ssl_match_hostname-3.4.0.2
  • tornado-4.0

Any idea what I'm doing wrong wrong?

1
I created a virtualenv and installed some packages using (using pip install rather than CG's packages). Now executing ipython notebook seems to work fine. pip freeze reports Jinja2==2.7.3 MarkupSafe==0.23 backports.ssl-match-hostname==3.4.0.2 certifi==14.05.14 ipython==2.1.0 pyreadline==2.0 pyzmq==14.3.1 tornado==4.0. This not a full solution, since I would like to be able to use a notebook from outside a virtual environment. - banbh
I created a virtualenv with --system-site-packages. Then from inside the venv I installed ipython and ran ipython notebook. This generated the errors as before. - banbh
Removing everything (namely all packages and python itself) followed by reinstalling python and the needed packages via pip seemed to get it to work. - banbh
Also, installing all the necessary packages from CG's site also results in a working installation. - banbh

1 Answers

0
votes

As best as I can make out my python configuration was in some bad state that was not fixed by upgrading single packages. However a full reinstall (see comments to my question) seemed to fix the problem. Also, since in trying to debug this I found that the ipython notebook worked in a virtual environment. I did not consider this a full solution because I typically needed binary packages (from Christoph Gohlke's site) which would then not be available in the venv. However, I then found the following blog post, which make venvs much more useful under Windows: http://www.philipsouthwell.com/blog/create-a-virtual-environment-with-windows/. In case the above link disappears, it boils down to this: you can download one of the CG packages (which is an EXE) and then install it from inside the venv by using easy_install.