python - Is there a way to use gevent in ipython notebook? -


i'm using library imports gevent. run in ipython notebook. first cell is:

print 'foo' import library print 'bar' 

but neither print happens. guess library patches thread, otherwise should work: https://github.com/ipython/ipython/issues/2785/#issuecomment-48009193

my ipython file (/usr/local/bin/ipython) looks this:

#!/usr/bin/python  # -*- coding: utf-8 -*- import re import sys  ipython import start_ipython  if __name__ == '__main__':     sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])     sys.exit(start_ipython()) 

i tried running copy of monkey patching @ top, based on asuggestion here: https://github.com/ipython/ipython/issues/4771. ipython loads fine, ipython notebook doesn't work.

what doing wrong?

try this, interactively in python shell. when working, create script need run command line.

python3 python 3.4.1 (v3.4.1:c0e311e010fc, may 18 2014, 00:54:21)  [gcc 4.2.1 (apple inc. build 5666) (dot 3)] on darwin type "help", "copyright", "credits" or "license" more information. >>> import ipython >>> ipython.start_ipython (argv = ['notebook', '--no-browser']) [i 17:31:43.672 notebookapp] using mathjax cdn: https://cdn.mathjax.org/mathjax/latest/mathjax.js [i 17:31:43.709 notebookapp] port 8888 in use, trying random port. [w 17:31:43.712 notebookapp] terminals not available (error no module named 'terminado') [i 17:31:43.713 notebookapp] serving notebooks local directory: /users/fred/dropbox/notebooks [i 17:31:43.713 notebookapp] 0 active kernels  [i 17:31:43.713 notebookapp] ipython notebook running at: http://localhost:8889/ [i 17:31:43.713 notebookapp] use control-c stop server , shut down kernels (twice skip confirmation). 

the --no-browser option avoids launching browser directly. omit if want local browser started automatically. in example, can point browser http://localhost:8889/. default, on port 8888.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -