Closed mwv closed 10 years ago
Sorry, I guess this is a duplicate of #133 and #137. Please consider closed.
If you are feeling adventurous, you could check out a copy of my fork which seems to be working under IPython 2.0. Note that you will need to modify your copy of iPython per this Stack Overflow question so you don't get a cross origin websocket error (whatever that is).
Some important caveats:
That said, give it a try and let me know how it breaks! I will try to fix if I can.
This is super exciting! Thanks for working on this. Looks like it's a bit broken though.
I'm on:
I ran lisp/zeroein.el and ipython2 notebook &:
2014-04-14 21:04:08.557 [NotebookApp] Using existing profile dir: u'/store/home/michael/.ipython/profile_default'
2014-04-14 21:04:08.564 [NotebookApp] Using MathJax from CDN: http://cdn.mathjax.org/mathjax/latest/MathJax.js
2014-04-14 21:04:08.587 [NotebookApp] The port 8888 is already in use, trying another random port.
2014-04-14 21:04:08.589 [NotebookApp] Serving notebooks from local directory: /home/michael/ipy-notebooks
2014-04-14 21:04:08.589 [NotebookApp] 0 active kernels
2014-04-14 21:04:08.589 [NotebookApp] The IPython Notebook is running at: http://127.0.0.1:8889/
2014-04-14 21:04:08.589 [NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
I then opened the notebook list. Flawless.
I then selected a notebook. Things didn't work. Emacs shows this in the *Messages*
buffer:
ein: [info] Opened notebook list at 8889
ein: [info] Opening notebook cache...
ein: [info] Kernel started: f6b3f731-7f56-4a62-8f91-80e0057b9a48
ein: [info] Starting WS: "ws://127.0.0.1:8889/api/kernels/f6b3f731-7f56-4a62-8f91-80e0057b9a48"
ein: [info] Unknown event: execution_count\.Kernel
ein: [info] Unknown event: status_busy\.Kernel
ein: [info] Unknown event: status_idle\.Kernel
and IPython prints this in stdout:
2014-04-14 21:04:45.897 [NotebookApp] Kernel started: 8f4838ff-6bfd-414c-afa4-d9e2de259fdb
ERROR:root:First ws message didn't have the form 'identity:[cookie]' - ''
ERROR:root:First ws message didn't have the form 'identity:[cookie]' - ''
[IPKernelApp] WARNING | Eventloop or matplotlib integration failed. Is matplotlib installed?
INFO:tornado.general:Malformed HTTP request from ('127.0.0.1', 39823): Malformed HTTP request line
(note that i do not have matplotlib
installed in this virtualenv so I expect the error about pylab inline not working)
Let me know how I can help with other debug info.
Thanks again for working on this! Being able to upgrade from 0.13.2 would be a dream come true!
Thanks for taking the time to try this out! And of course I can't reproduce your issue. Sorry about that. Note that I am also getting the 'identity:[cookie]' and malformed HTTP request messages when I use ein, however I am not seeing the Unknown event messages in Emacs.
Those messages last cropped up in #121, but I thought tkf fixed with patch 146fc45. I'm not sure how to troubleshoot (I'm not nearly as smart as tkf-san), but as good a place to start as any is to send a report from ein:dev-bug-report-template.
millejoh, thanks for the patch. I've been trying it out for some time and it seems to work great. I'm getting the identity:[cookie] messages, but they don't stop the notebook from working.
would it be an idea to send a pull request with these patches?
I am still getting websocket error on Mac OS X 10.8.5. Does the patch work on Mac (Aquamacs )? Thanks,
@millejoh , you are a wizard! I just retried your fork and it works beautifully. (I think the issue was that I accidentally installed 'ein' twice.
For those of you just joining in, here's how to get this working on Emacs 24, IPython 2.0.0, and ein:
site-packages
folder is if you're in a virtualenv) and comment out the Cross-Origin check near line 114:if not self.same_origin():
self.log.warn("Cross Origin WebSocket Attempt.")
raise web.HTTPError(404)
Just comment that out.
M-x ein:ein-notebooklist-open
as usual.Now when I connect to a notebook, I get this on ipython's stdout:
ERROR:root:First ws message didn't have the form 'identity:[cookie]' - ''
ERROR:root:First ws message didn't have the form 'identity:[cookie]' - ''
but everything seems to work.
My packages are:
Things I tested:
Things I did not test:
Earlier, I posted that it did not work, but it does now!
Thanks again everyone! I owe you BUNCHES.
@millejoh and @gcr Thanks you guys. Now I can use Ipython 2 again. I did notice that I cannot open the file if it contains "space" . It might be the same with ipython 1.1. Can anyone be able to use
%config InlineBackend.figure_format = 'retina' # Use for retina display resolution
When I tried , the figure looks larger than the screen.
I tested 3D plot with Matplotlib and it works fine.
Found a small bug in @millejoh 's fork: the pager does not open. This one-line fix fixes that regression: https://github.com/gcr/emacs-ipython-notebook/commit/9c90f25e5a6fd21d3ec112eb484e2afa41ee55f2
Also, sorry for the noise, but this fixes the the regression of not being able to open notebooks with spaces in their name: https://github.com/gcr/emacs-ipython-notebook/commit/1914e68b8976a0a0fa64839fdb5910ae3141b4bd
(I'm not sure if this is the correct thing to do, but it works for me)
Finally, there is one last weird thing with @millejoh 's fork: when saving a notebook, it fails once, retries, and then finishes. In the *Messages*
buffer, I get:
ein: [info] Retry saving... Next count: 1
ein: [info] Notebook is saved.
ein: [info] Failed to save notebook!
ein: [info] Status code (=200) is not 204 and retry exceeds limit (=1).
ein: [info] Notebook is saved.
And in the *ein:log-all*
buffer, I get:
[debug] Event: notebook_saving\.Notebook @#<buffer *ein: 8888/Triplets CKL.ipynb*>
[info] Retry saving... Next count: 1 @#<buffer *ein: 8888/Triplets CKL.ipynb*>
[debug] Event: notebook_saving\.Notebook @#<buffer *ein: 8888/Triplets CKL.ipynb*>
[info] Notebook is saved. @#<buffer *ein: 8888/Triplets CKL.ipynb*>
[debug] Event: notebook_saved\.Notebook @#<buffer *ein: 8888/Triplets CKL.ipynb*>
[info] Failed to save notebook! @#<buffer *ein: 8888/Triplets CKL.ipynb*>
[debug] Event: notebook_save_failed\.Notebook @#<buffer *ein: 8888/Triplets CKL.ipynb*>
[info] Status code (=200) is not 204 and retry exceeds limit (=1). @#<buffer *ein: 8888/Triplets CKL.ipynb*>
[info] Notebook is saved. @#<buffer *ein: 8888/Triplets CKL.ipynb*>
[debug] Event: notebook_saved\.Notebook @#<buffer *ein: 8888/Triplets CKL.ipynb*>
But from the comments in ein-notebook.el:645-649
, maybe this is expected?
Not a big deal. They eventually save correctly and they're not corrupted yet (I think)
@gcr - Thank you for the patches! I just merged them in to my fork. Good work!
I too have noticed the odd retry messages when saving notebooks. From what I have seen the messages and from what I could figure out from the code is that this is expected in some (all?) cases. Everything still seems to work, thankfully.
@mwv - Things may be stable enough to send a pull request, but the changes I made make EIN backwards incompatible with ipython 1.x and earlier. I'm not sure how many people out there are still using EIN+ipython1.0, so I would rather wait for @tkf to chime in and state his preference of how he wants to handle.
I'm trying to compile millejoh's code above (pretty vanilla ubuntu 14.04, emacs 24.3, python 2.7.6, ipython 2.1.0 (with modded zmqhandlers.py as above), zmq 4.0.4). But when I clone and "make" I get 147/257 tests failed. E.g.,:
... Ran 257 tests, 110 results as expected, 147 unexpected (2014-07-04 01:44:40-0700)
147 unexpected results: FAILED ein:cell-insert-output-display-data-html FAILED ein:cell-insert-output-display-data-javascript FAILED ein:cell-insert-output-display-data-latex ...
This may be unrelated, but I get the following warning re zeromq early during the make:
... python --version Python 2.7.6 env/ipy.0.13.0/bin/ipython --version /home/matthai/install/ein/env/ipy.0.13.0/local/lib/python2.7/site-packages/IPython/zmq/init.py:65: RuntimeWarning: libzmq 4 detected. It is unlikely that IPython's zmq code will work properly. Please install libzmq stable, which is 2.1.x or 2.2.x RuntimeWarning) 0.13
Any suggestions?
Heads up -- the websocket issue is fixed in https://github.com/ahyatt/emacs-websocket/pull/35 , so EIN now works without any patches to IPython or Tornado (tested in IPython 2.1.0, and millejoh's fork)
With python 2.0, attempting to call ein:notebooklist-open gives the following error:
REQUEST [error] Error from parser ein:json-read: (json-readtable-error) ein: [error] Error (parse-error) while opening notebook list at the server http://127.0.0.1:8888/.
Running ein version ein-20140317.1114