Table of Content

It is such painful to install jupyter notebook in cygwin64, so let’s be patient go through one step by step.

install jupyter using pip

$ pip install jupyter

first failure is on pyzmq:
Running setup.py bdist_wheel for pyzmq … error

$ pip install pyzmq
Collecting pyzmq
Using cached pyzmq-16.0.2.tar.gz

still failed but at least we got pyzmq version 16.0.2

manually install pyzmq from tarballs

$ wget https://github.com/zeromq/pyzmq/archive/v16.0.2.tar.gz
$ gunzip v16.0.2.tar.gz
$ tar xvf v16.0.2.tar
$ cd v16.0.2
$ python setup.py install

it failed but download bundled libzmq,

Using bundled libzmq
fetching https://github.com/zeromq/zeromq4-1/releases/download/v4.1.6/zeromq-4.1.6.tar.gz into bundled

Fatal: Cython-generated file 'zmq/devices/monitoredqueue.c' not found.
Cython >= 0.20 is required to compile pyzmq from a development branch.
Please install Cython or download a release package of pyzmq.

install Cython

$ pip install Cython
Successfully installed Cython-0.25.2

re-run pyzmq install

$ python setup.py install

it goes further but still failed,

collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

manually compile bundled zeromq 4.1.6 from source

cd ~/zmq/pyzmq-16.0.2/bundled/zeromq
$ ./configure
$ make
$ make install

install pyzmq again, failed on different error

$ pip install pyzmq
Collecting pyzmq
Using cached pyzmq-16.0.2.tar.gz
Installing collected packages: pyzmq
Running setup.py install for pyzmq

bundled/zeromq/src/signaler.cpp:62:25: fatal error: sys/eventfd.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

remedy

http://stackoverflow.com/questions/31082901/installing-pzmq-with-cygwin
https://github.com/zeromq/pyzmq/issues/113#issuecomment-25192831

# shared libraries broken with 0MQ on Cygwin64
# manual shared library link and install from static library

gcc -shared -o cygzmq.dll -Wl,--out-implib=libzmq.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive .libs/libzmq.a -Wl,--no-whole-archive -lstdc++
install include/zmq.h /usr/local/include
install include/zmq_utils.h /usr/local/include
install cygzmq.dll /usr/local/bin
install libzmq.dll.a /usr/local/lib

successfully installed pyzmq

$ pip install pyzmq
Collecting pyzmq
Using cached pyzmq-16.0.2.tar.gz
Installing collected packages: pyzmq
Running setup.py install for pyzmq ... done
Successfully installed pyzmq-16.0.2

successfully installed jupyter

$ pip install jupyter

jupyter notebook test

$ jupyter notebook
[I 17:45:59.693 NotebookApp] Serving notebooks from local directory: /home/userid
[I 17:45:59.697 NotebookApp] 0 active kernels
[I 17:45:59.698 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=bb28e628cfd9f5cfb90afbbebd4aeaa164dce74662d148a4
[I 17:45:59.699 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 17:45:59.704 NotebookApp] No web browser found: could not locate runnable browser.
[C 17:45:59.705 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=bb28e628cfd9f5cfb90afbbebd4aeaa164dce74662d148a4

I still prefer ipython cli, good lightweight debug tool for python.

$ ipython
Python 2.7.12 (default, Oct 10 2016, 12:56:26)
Type "copyright", "credits" or "license" for more information.

IPython 5.3.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: