tkf / emacs-ipython-notebook Goto Github PK
View Code? Open in Web Editor NEWIPython notebook client in Emacs
Home Page: tkf.github.com/emacs-ipython-notebook/
License: GNU General Public License v3.0
IPython notebook client in Emacs
Home Page: tkf.github.com/emacs-ipython-notebook/
License: GNU General Public License v3.0
By 6f3fb3b, I started using (comint-carriage-motion START END)
. This function removes character of the outside of the given region if the START point is not at the beginning of line. This probably causes something wrong in EWOC side because this means comint-carriage-motion
may remove some characters from previous EWOC node.
Possible fix is to treat continuous output stream as one EWOC node, like what HTML client in IPython does.
Got error from the on-message function: JSON readtable error
or provide something like that
IPython notebook 0.13 supports headline cells. Overview buffer using something like direx should be useful. Maybe this feature should be extensible for more than two worksheets because IPython might support it in 0.14 (or later).
I just discovered ein by accident, and love the idea. I installed it on Emacs 24.1 (WIndows and OS X), fired up the iPython notebook, and tried to open a notebook I'd previously created in my Web browser. Unfortunately, opening the file (on both systems) gives me the following error (here I'm copying what's shown in my Messages buffer):
Contacting host: 127.0.0.1:8888
Opened notebook list at 8888
Open notebook analyze.
Contacting host: 127.0.0.1:8888
ein: [error] Wrong number of arguments: #[... "p�\306 ���\307\310
�\311\211 \311&�+`��p� \211��\312H��>\204)
Actually, the error message is a lot longer than this, but I think it contains binary control characters that screw up my ability to paste it here... The only recognizable text in the error message is at the end,
[pretty-printer dll buffer pos new-ewoc old-buffer ewoc--dll-create vector cl-struct-ewoc nil ...] 9 ...], 4
Any idea what's going wrong? I'd love to get this running.
Thanks.
This is the problem when there are notebooks with different file name with same notebook name.
*ein: 8888/Notebook (2)*
.notebook-id
-based buffer name.In addition to el-get, please make the project available for the Emacs24 built-in package manager package.el
I see various customize options in ein for what fonts to use to display different level titles, but my titles just display in Emacs as plain text, e.g.,
I'm probably missing something trivial, but how do I get them to display properly?
IPython support many languages via cell magic commands. It's better to support them in EIN when the modes for this languages are installed.
Two notes on the repo:
Hi! I'm the mantainer of https://github.com/gabrielelanaro/emacs-for-python I'd really like to make my package compatible with ein.
Right now I'm having problems setting ein up, what I obtain is an "invalid file name" error message my mumamo when I open a notebook and head over a cell. The problem disappears when i manually load python-mode.
the relevant part of the initialization file is something like this:
(load-file "~/workspace/emacs-for-python/epy-init.el")
(add-to-list 'load-path "~/workspace/emacs-websocket/")
(add-to-list 'load-path "~/workspace/emacs-ipython-notebook/")
(add-to-list 'load-path "~/workspace/ein/zeroein/markdown-mode/")
(require 'markdown-mode)
(load-file "~/workspace/ein/zeroein/nxhtml/autostart.el")
(require 'ein)
If you comment emacs-for-python loading all is ok. I suspect this is something related to other things that gets loaded with python-mode (rope, other stuff..). There's a way I can disable them when loading python-mode in the mumamo environment?
C-c C-q ein:notebook-kill-kernel-then-close-command
Output of the help should be truncated to fit in ~80 columns and height should not be larger than current frame size.
In emacs using
python zeroein/zeroein.py --emacs `which emacs-snapshot`
I get this:
Contacting host: 127.0.0.1:8888
ein: [error] Error (error) while opening notebook list at the server 8888.
Contacting host: 127.0.0.1:8888
The terminal running ipython notebook
reports
WARNING:root:404 GET /notebooks%3f_%3d1341211357 (127.0.0.1) 0.43ms
Interestingly if I decode the url and go to http://127.0.0.1:8888/notebooks?_=1341211357
in my browser I get the json response that I assume ein is expecting:
[{"name":"test","notebook_id":"1c7fc74f-4037-4f47-823e-ef6fbea4d5c9"}]
emacs version: GNU Emacs 24.1.50.1
ipython version: 0.13.dev
Putting many files in top level directory is a bit ugly.
But how to do it properly?
relevant: #5
Just a quick lookup.
lisp/
(no subdirectories under it):% cd ~/.emacs.d/el-get/el-get/recipes
% grep '"lisp"' *.rcp
ess.rcp: :load-path ("lisp")
jdee.rcp: :load-path ("lisp" "elib"))
nognus.rcp: :load-path ("lisp")
org-mode.rcp: :load-path ("." "lisp" "contrib/lisp")
reftex.rcp: :load-path ("lisp")
session.rcp: :load-path ("lisp")
method/
directory for submodules.load-path
is automatically modified.The change introduced by ipython/ipython#2051 (Add a metadata attribute to messages) breaks EIN.
Notebook server can be protected by a password.
But currently EIN cannot connect to password-protected server.
http://ipython.org/ipython-doc/dev/interactive/htmlnotebook.html#security
I have no plan for implementing this feature. If someone is interested in implementing this, patches are very welcome.
This should not effect to the data to store. I just need to filter out unused characters including "\r" itself in output stream before inserting it.
See also the PRs for the web interface:
EIN is fantastic, and it is working perfectly with my local notebook.
However, I often connect to a remote notebook. To do this I set up a ssh tunnel, such that I can still access the remote notebook on the localhost (e.g. http://127.0.0.1:9999). The setup works perfectly in my broswer (including tab complete, inline plotting, etc).
Within EIN I can still connect to the remote notebook, execute cells, view output, etc... but I'm unable to do any tab complete using C-c TAB. Doing so returns the following error message:
Error found in callback `on-message': nil
Any insight?
Thanks,
Aaron
Or probably just makes it easier to search them via anything/helm by changing the buffer format from *ein: NAME*
to *ein:nb NAME*
.
I'd really to be able to use something like this with sage. I gave it a try with Sage 5.2, running with IPython 0.13, but it just said ein: [error] Error (error) while opening notebook list at the server 8092. I'm unfamiliar with the IPython notebook but does it require a username and password to log in? I think that might be why it wasn't working.
Fix similar to #20 should be applied.
Uncompiled ein-ac.el could cause problem.
See also: #42
This allows kernel to be used in any buffer. It will provide good completion, annotation and evaluation backend. I need to add more test for ein-kernel.el and then refactor it.
Example usage:
The following sequence reliably produces an error (running zeroein on Emacs 23):
for i in xrange(10):
in an empty cell.No tab is inserted, the cursor leaves the cell, and the following traceback is produced:
part 2 [python-mode]: chu-min=32 chu-max=33 chu-last-bol=nil
apply: Wrong length inserted in mirror [python-mode]: change-beg=10 part=3, chu-max=33, pm=34
Toggling font-lock-mode off; better pass an explicit argument.
ein:connect-to-notebook
should allow to connect the notebook which is not yet opened
This makes easy to log one sub-package (e.g., ein-kernel.el) without contaminating log buffer by debugging messages from other sub-packages (e.g., ein-mumamuo.el, which sends a lot of messages).
I get this message when I try to execute anything in a newly opened notebook.
On opening a notebook, the following appears in Messages:
error in process filter: if: Wrong number of arguments: #[(name buffer host service) "ÄÅ�Æ Ç
�&��" [name buffer host service make-network-process :name :buffer :host :service] 9 "Open a TCP connection for a service to a host.
Returns a subprocess-object to represent the connection.
Input and output work as for subprocesses; `delete-process' closes it.
NAME is the name for the process. It is modified if necessary to make
it unique.
BUFFER is the buffer (or buffer name) to associate with the
process. Process output goes at end of that buffer. BUFFER may
be nil, meaning that this process is not associated with any buffer.
HOST is the name or IP address of the host to connect to.
SERVICE is the name of the service desired, or an integer specifying
a port number to connect to.
This is a wrapper around `make-network-process', and only offers a
subset of its functionality."], 8
error in process filter: Wrong number of arguments: #[(name buffer host service) "ÄÅ�Æ Ç
�&��" [name buffer host service make-network-process :name :buffer :host :service] 9 "Open a TCP connection for a service to a host.
Returns a subprocess-object to represent the connection.
Input and output work as for subprocesses; `delete-process' closes it.
NAME is the name for the process. It is modified if necessary to make
it unique.
BUFFER is the buffer (or buffer name) to associate with the
process. Process output goes at end of that buffer. BUFFER may
be nil, meaning that this process is not associated with any buffer.
HOST is the name or IP address of the host to connect to.
SERVICE is the name of the service desired, or an integer specifying
a port number to connect to.
This is a wrapper around `make-network-process', and only offers a
subset of its functionality."], 8
After attempting to execute print "something"
in a cell, the tail of ein:log-all looks like this:
[debug] Opening notebook at http://127.0.0.1:8888/notebooks/8c2b1350-c164-4dc3-a061-b163d6eda191 @#<buffer *ein:notebooklist 8888*>
[debug] EIN:QUERY-AJAX @#<buffer *ein:notebooklist 8888*>
[debug] Start querying: http://127.0.0.1:8888/notebooks/8c2b1350-c164-4dc3-a061-b163d6eda191 @#<buffer *ein:notebooklist 8888*>
[debug] Start timer: timeout=60000 ms @#<buffer *ein:notebooklist 8888*>
[debug] EIN:QUERY-AJAX-CALLBACK @#<buffer *http 127.0.0.1:8888*>
[debug] status = nil @#<buffer *http 127.0.0.1:8888*>
[debug] url-http-response-status = 200 @#<buffer *http 127.0.0.1:8888*>
[debug] (buffer-string) =
HTTP/1.1 200 OK
Content-Length: 103
Content-Disposition: attachment; filename="Untitled0.ipynb"
Server: TornadoServer/2.3
Last-Modified: Sat, 28 Jul 2012 02:11:07 GMT
Etag: "d0196f981d8ca623e6efb94f20048a11aa7bfe93"
Content-Type: application/json
Set-Cookie: username=; expires=Fri, 29 Jul 2011 02:28:22 GMT; Path=/
{
"metadata": {
"name": "Untitled0"
},
"name": "Untitled0",
"nbformat": 2,
"worksheets": []
} @#<buffer *http 127.0.0.1:8888*>
[debug] EIN:QUERY-AJAX-CANCEL-TIMER @#<buffer *http 127.0.0.1:8888*>
[debug] data = (:worksheets nil :nbformat 2 :name Untitled0 :metadata ...) @#<buffer *scratch*>
[debug] canceled = nil @#<buffer *scratch*>
[debug] Executing success/error callback. @#<buffer *scratch*>
[debug] URL-RETRIEVE nodtebook-id = "8c2b1350-c164-4dc3-a061-b163d6eda191", status = nil @#<buffer *scratch*>
[verbose] Start logging. @#<buffer *ein: 8888/Untitled0*>
[debug] EIN:QUERY-AJAX @#<buffer *ein: 8888/Untitled0*>
[debug] Start querying: http://127.0.0.1:8888/kernels?notebook=8c2b1350-c164-4dc3-a061-b163d6eda191 @#<buffer *ein: 8888/Untitled0*>
[debug] Start timer: timeout=1000 ms @#<buffer *ein: 8888/Untitled0*>
[info] Notebook Untitled0 is ready @#<buffer *ein: 8888/Untitled0*>
[debug] Executing status-code callback. @#<buffer *scratch*>
[debug] EIN:QUERY-AJAX-CALLBACK @#<buffer *http 127.0.0.1:8888*>
[debug] status = nil @#<buffer *http 127.0.0.1:8888*>
[debug] url-http-response-status = 200 @#<buffer *http 127.0.0.1:8888*>
[debug] (buffer-string) =
HTTP/1.1 200 OK
Content-Length: 83
Content-Type: text/html; charset=UTF-8
Location: /907511d6-c6a5-4eb2-a0f8-7bc51246a340
Server: TornadoServer/2.3
Set-Cookie: username=; expires=Fri, 29 Jul 2011 02:28:22 GMT; Path=/
{"kernel_id":"907511d6-c6a5-4eb2-a0f8-7bc51246a340","ws_url":"ws://127.0.0.1:8888"} @#<buffer *http 127.0.0.1:8888*>
[debug] EIN:QUERY-AJAX-CANCEL-TIMER @#<buffer *http 127.0.0.1:8888*>
[debug] data = (:ws_url ws://127.0.0.1:8888 :kernel_id 907511d6-c6a5-4eb2-a0f8-7bc51246a340) @#<buffer *scratch*>
[debug] canceled = nil @#<buffer *scratch*>
[debug] Executing success/error callback. @#<buffer *scratch*>
[info] Kernel started: 907511d6-c6a5-4eb2-a0f8-7bc51246a340 @#<buffer *scratch*>
[info] Starting WS: "ws://127.0.0.1:8888/kernels/907511d6-c6a5-4eb2-a0f8-7bc51246a340" @#<buffer *scratch*>
[warn] Kernel is not ready yet! (or closed already.) @#<buffer *ein: 8888/Untitled0*>
It should be possible to reconnect to different server/notebooks. Reconnecting to different notebook is effectively as same as "Save as" functionality.
See also:
melpa/melpa#185 (comment)
Enter the following in code cell ([]
is the cursor position) then hit TAB twice:
def f():
pass
[]
causes the following error:
part 2 [python-mode]: chu-min=34 chu-max=35 chu-last-bol=nil
apply: Wrong length inserted in mirror [python-mode]:
change-beg=10 part=3, chu-max=35, pm=36
See also:
It seems imaxima-make-image is general enough to use it outside of imaxima.
Note that imaxima-make-image consider buffer width when drawing equations, which is great.
Currently, all notebooks (opened or not) are listed as candidates. It is useful if I can see opened or not before connecting.
First of all, I need to migrate to helm from anything...
MuMaMo is nice but it takes a little bit too much CPU power and I need some hack to use it with auto-complete. So, maybe it's better to have alternative.
This is a proof of concept snippet:
(defun my-pop-to-pygmentized (string lexer)
(with-current-buffer (get-buffer-create "*my pygmentized*")
(erase-buffer)
(insert string)
(shell-command-on-region
(point-min) (point-max)
(format "pygmentize -l %s" lexer)
nil t)
(ansi-color-apply-on-region (point-min) (point-max))
(pop-to-buffer (current-buffer))))
(my-pop-to-pygmentized "\
import numpy
numpy.arange(0, 10)" "python")
See a7ed0ca
In order to get zeroein.el to load the ein elisp files, I had to change the load list from
'("ein" "markdown-mode" "websocket" "python" "auto-complete" "popup" "fuzzy" "pos-tip" "smartrep")
to
'("ein/lisp" "markdown-mode" "websocket" "python" "auto-complete" "popup" "fuzzy" "pos-tip" "smartrep")
.
I don't know whether this issue is specific to my configuration (Emacs 23 on Debian).
Use auto-complete API. I need to find out how to.
I'm attempting to install EIN. The ein:notebooklist opens fine, but when I attempt to open a notebook, i receive the following error:
" Cannot open load file: mumamo-cmirr"
and the Notebook opens in the Fundamental mode.
Any suggestions?
Thanks,
Aaron
After the saving failure, you can save it again if you repeat the command "C-x C-s".
This is maybe a bug in Emacs url-retrieve
.
See: #11469 - 24.1.50; url-retrieve with PUT method fails every two times - GNU bug report logs
Note: It is possible to implement workaround for this. So maybe I should do it sometime later.
Also maybe related to the issue of url-retrieve
, network connection is not closed sometimes (You can see it in the *Process List*
buffer).
Try:
%run ~/some/existing/path[TAB]
When I attempt to connect to a notebook with password security, I receive an error.
Are notebooks with password security (set up using ipython config variable c.NotebookApp.password) accessible with EIN?
Thanks.
Is an EIN menu planned? I think a menu would help users to explore the various commands in the EIN package.
Probably dynamically binding url-automatic-caching
to nil
is enough.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.