julialang / ijulia.jl Goto Github PK
View Code? Open in Web Editor NEWJulia kernel for Jupyter
License: MIT License
Julia kernel for Jupyter
License: MIT License
When installing IJulia on Windows it breaks with the following error message:
WARNING: An exception occured while building binary dependencies.
You may have to take manual steps to complete the installation, see the error message below.
To reattempt the installation, run Pkg.fixup("Nettle").
in build at pkg.jl:259
ERROR: None of the selected providers can install dependency nettle
in error at error.jl:21
in satisfy! at C:\Documents and Settings\myprofile\Application Data\julia\packages\BinDeps\src\dependencies.jl:403
in anonymous at C:\Documents and Settings\myprofileApplication Data\julia\packages\BinDeps\src\dependencies.jl:413
in include at boot.jl:238
in include_from_node1 at loading.jl:96
in anonymous at no file:262
in cd at file.jl:36
in cd at pkg/dir.jl:28
in build at pkg.jl:259
in __fixup at pkg.jl:311
in _fixup at pkg.jl:338
in _fixup#g157 at no file
in _fixup#g156 at no file
in _fixup#g155 at no file
in _resolve at pkg.jl:249
in _resolve at no file
in anonymous at no file:33
in cd at file.jl:36
in cd at pkg/dir.jl:28
in edit at pkg.jl:23
in add at pkg.jl:20
at C:\Documents and Settings\myprofileApplication Data\julia\packages\Nettle\deps\build.jl:24
Is IJulia supposed to be working on Windows (XP)?
Starting up a fresh IJulia session, when I enter anything, the following message appears in the terminal session where I launched ipython:
ERROR:root:Uncaught exception POST /kernels?notebook=3f665c6a-dbe5-4fa7-a7f6-30038069d071 (127.0.0.1)
HTTPRequest(protocol='http', host='127.0.0.1:8998', method='POST', uri='/kernels?notebook=3f665c6a-dbe5-4fa7-a7f6-30038069d071', version='HTTP/1.1', remote_ip='127.0.0.1', body='', headers={'Origin': 'http://127.0.0.1:8998', 'Content-Length': '0', 'Accept-Language': 'en-US,en;q=0.8', 'Accept-Encoding': 'gzip,deflate,sdch', 'Host': '127.0.0.1:8998', 'Accept': 'application/json, text/javascript, */*; q=0.01', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.62 Safari/537.36', 'Connection': 'keep-alive', 'X-Requested-With': 'XMLHttpRequest', 'Referer': 'http://127.0.0.1:8998/3f665c6a-dbe5-4fa7-a7f6-30038069d071'})
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/tornado/web.py", line 954, in _execute
getattr(self, self.request.method.lower())(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/tornado/web.py", line 1667, in wrapper
return method(self, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/IPython/html/services/kernels/handlers.py", line 46, in post
kernel_id = km.start_kernel(notebook_id, cwd=nbm.notebook_dir)
File "/usr/local/lib/python2.7/site-packages/IPython/html/services/kernels/kernelmanager.py", line 86, in start_kernel
kernel_id = super(MappingKernelManager, self).start_kernel(**kwargs)
File "/usr/local/lib/python2.7/site-packages/IPython/kernel/multikernelmanager.py", line 115, in start_kernel
km.start_kernel(**kwargs)
File "/usr/local/lib/python2.7/site-packages/IPython/kernel/manager.py", line 205, in start_kernel
**kw)
File "/usr/local/lib/python2.7/site-packages/IPython/kernel/manager.py", line 161, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File "/usr/local/lib/python2.7/site-packages/IPython/kernel/launcher.py", line 251, in launch_kernel
stdin=_stdin, stdout=_stdout, stderr=_stderr, cwd=cwd, env=os.environ)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
ERROR:root:500 POST /kernels?notebook=3f665c6a-dbe5-4fa7-a7f6-30038069d071 (127.0.0.1) 24.56ms
All we need to do is to provide write_svg(io, x)
or write_png(io, x)
functions for graphical object types in libraries like Winston (using Cairo's ability to render to a stream).
Eventually, this should go directly into Winston etcetera, but for demo purposes (especially since the display
stuff hasn't yet been merged into Base
) we might want to add a few key ones here to start with.
We have a barely functional execute_request
, with many omissions:
pyerr
messages in #4.stdout
/stderr
(see Julia #3823)repr
, but we should instead print just like they are printed in the REPLIf I launch the IJulia notebook server and start a new notebook, I see messages in the terminal about a kernel starting. If I open a previously saved notebook, though, I cannot run any commands, and a julia kernel is never started.
I am using ipython 1.0.0 and julia master on OS X 10.7.5.
In the notebook, there is a menu item "Kernel Interrupt", which I suspect sends a SIGINT to the kernel process. It would be good to catch this as a keyboard interrupt, just as we do in the REPL.
(I seem to remember there was a function somewhere in the Julia REPL startup which installed the signal handler for this, so we would just need to call this function and catch the exception in appropriate places.)
Got the above warning. After updating to the new version of IJulia.
Hi,
Still discovering julia, using help I saw that you have latex in it sometime :
Base.fft(A[, dims])
Performs a multidimensional FFT of the array "A". The optional
"dims" argument specifies an iterable subset of dimensions (e.g.
an integer, range, tuple, or array) to transform along. Most
efficient if the size of "A" along the transformed dimensions is
a product of small primes; see "nextprod()". See also
"plan_fft()" for even greater efficiency.
A one-dimensional FFT computes the one-dimensional discrete Fourier
transform (DFT) as defined by \operatorname{DFT}[k] =
\sum_{n=1}^{\operatorname{length}(A)} \exp\left(-i\frac{2\pi
(n-1)(k-1)}{\operatorname{length}(A)} \right) A[n]. A
multidimensional FFT simply performs this operation along each
transformed dimension of "A".
In IPython we will probably at some time extend the help system to be able to return different "mimetype" for docstrings. Not quit sure how (brainstorming welcommed), but I was thinking that you guys might also want to start building that into julia core. You could for example already return the previous thing as HTML, and the Latex Should be rendered in notebook...
The heartbeat ZMQ socket needs to be in a different thread, so that IPython knows that the kernel is alive even if we are in some long-running computation.
Ideally, we wouldn't fork off a whole new Julia process, but would simply spawn a lightweight thread: just needs to be a simple loop to receive and forward messages, which should be possible with no memory allocation ... with careful coding, it may be possible to code this in a thread-safe way in pure Julia (as a callback passed to pthread_create
or the Windows equivalent).
In ZMQ version 2, we could just call http://api.zeromq.org/2-1:zmq-device once in the thread and be done, but this function was apparently removed in ZMQ version 3 (change was apparently reverted; zmq_device
was retained in ZMQ 3 for compatibility).
@JeffBezanson's help on Julia thread-safety would be useful here. Or we could write a little C routine if necessary, of course.
Currently, we only (barely) support execute_request
and the corresponding replies. We need to support all of the IPython message types:
execute_request
and execute_reply
(incomplete, see #5)pyout
getattr_request
and getattr_reply
/ setattr_request
and setattr_reply
(these may not actually be part of the spec as per @minrk's comment below)object_info_request
and object_info_reply
complete_request
and complete_reply
history_request
and history_reply
(needed in qtconsole front-end). Stub implementation (commit f1da940) pending clarification in ipython/ipython#3806.connect_request
and connect_reply
kernel_info_request
and kernel_info_reply
shutdown_request
and shutdown_reply
stream
(need stdout/stderr redirection from Julia #3823)display_data
(depends on JuliaLang/julia#3817)data_pub
pyin
pyerr
(may require protocol updates with IPython folks)status
crash
input_request
/ input_reply
(stdin redirection) #42Right now the Notebook interface has a "Cluster" tab that I've been ignoring. But it would be good if someone could look into IPython's cluster machinery and figure out how to integrate it with Julia's parallel computing facilities.
Hi everyone,
I built the latest version of Julia from git, built it, then tried to mess around with the iPython package, and got this error:
Warning: New definition
getindex(ShellCompleteString,Any...) at /home/fedev/.julia/REPLCompletions/src/REPLCompletions.jl:129
is ambiguous with
getindex(String,Range1{Int64}) at string.jl:659.
Make sure
getindex(ShellCompleteString,Range1{Int64})
is defined first.
Warning: New definition
getindex(ShellCompleteString,Any...) at /home/fedev/.julia/REPLCompletions/src/REPLCompletions.jl:129
is ambiguous with
getindex(String,Range1{T<:Integer}) at string.jl:59.
Make sure
getindex(ShellCompleteString,Range1{T<:Integer})
is defined first.
Warning: New definition
getindex(ShellCompleteString,Any...) at /home/fedev/.julia/REPLCompletions/src/REPLCompletions.jl:129
is ambiguous with
getindex(String,AbstractArray{T,1}) at string.jl:61.
Make sure
getindex(ShellCompleteString,AbstractArray{T,1})
is defined first.
[IPythonQtConsoleApp] WARNING | kernel restarted
The kernel keeps restarting forever. I am using iPython 1.0, and the Anaconda Python on Ubuntu 13.04.
When I run print("Test")
in an IJulia notebook the string is printed to the terminal but not as the result of the cell in the notebook as is the case when I run print "Test"
in an IPython notebook.
The notebook doesn't seem to use the history_request
mechanism yet, but it is used in the qtconsole. Currently, we have a stub implementation that saves no history, but it would be good to implement a saved-history file if people are going to use the console.
I was thinking of using an implementation and file format similar to what @loladiro is experimenting with in his REPL.jl module. On the other hand, IPython uses an SQLite database, which seems like overkill for a sequential list of strings but I guess is nicer if multiple processes want to write history?
IPython technically requests the text/plain output from the history too, as @minrk explained in ipython/ipython#3806. I'm not sure why, though—it doesn't seem like qtconsole and I was thinking of just saving the input strings and sending empty output strings to IPython.
Shell commands do not work in IJulia. It is trying to execute ls()
instead.
;ls
Out[1]:
# methods for generic function ls
ls(args...) at deprecated.jl:231
I've played with this code a bit on OSX by changing the path to julia-release.so to julia-release.dylib. When I try to load the magic I get an error that the "Resource is temporarily unavailable". I've also tried running the lines from julia.py
that initialize julia, load PyCall, etc. inside an IPython session and have found that the code breaks because the line self.jcall('PyObject')
returns None
and the resulting calls that use the returned function seg fault because of this. However, on Linux the call to sefl.jcall('PyObject')
returns a function pointer that can be used. Is there something obvious that needs to be done when initializing julia-release.dylib on OSX? I'm going to look through the code for the repl, but I was just wondering if anyone knew off the top of their head.
It would be great to get the julia magic working as the ipython notebook is an awesome way to do research. I'd be glad to help in any way I can.
Thanks.
This is perhaps a bit of an umbrella issue. I would like to have julia-ipython be ready for the classes this Fall. With stuff such notebookcloud, hosting such a solution for general use on tryjulia.org through EC2 seems like a possibility. As discussed on the mailing list, the earlier web-repl used to get about 50 trials a day and a few hundred a day whenever there was a mention on hackernews etc.
It would be nice to have a list of all the things that have to be done, so that they can be tracked for such a solution to be taken live in the next few months.
So far, I thought JuliaLang/julia#2775 was a bottleneck, but that has been resolved.
Requires a bit of refactoring of help
so that we can output to a string rather than to STDOUT
.
I was able to install IJulia just fine, but when I tried to run ipython notebook --profile=julia
, I was met with the following error:
ImportError: IPython.html requires pyzmq >= 2.1.11
After a sudo pip install pyzmq
, the startup process succeeded.
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "help()" to list help topics
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.2.0-prerelease+3587
_/ |\__'_|_|_|\__'_| | Commit 011a127 2013-09-02 03:09:36 UTC
|__/ | x86_64-apple-darwin12.4.0
julia> using IJulia
connect ipython with --existing /Users/csail-user/profile-46277.json
However, ipython
, ipython notebook
, and ipython notebook --profile julia
all seem to die when I try and use the --existing
flag:
$ ipython notebook --existing /Users/csail-user/profile-46277.json
...
2013-09-03 15:34:27.633 [NotebookApp] CRITICAL | Bad config encountered during initialization:
2013-09-03 15:34:27.633 [NotebookApp] CRITICAL | Unrecognized flag: '--existing'
We support the complete_request message, but the implementation needs to be expanded to actually do the right thing, and handle dots etc.
Not sure to what.. maybe an "REPL" package issue:
ERROR: could not open file /Users/bussonniermatthias/julia/Color.jl
in include_from_node1 at loading.jl:92
in reload_path at loading.jl:117
in require at loading.jl:48
in include_from_node1 at loading.jl:92
in reload_path at loading.jl:117
in require at loading.jl:48
in include_from_node1 at loading.jl:92
in reload_path at loading.jl:117
in require at loading.jl:48
in include_from_node1 at loading.jl:92 (repeats 2 times)
in process_options at client.jl:274
in _start at client.jl:352
at /Users/bussonniermatthias/.julia/Terminals/src/Terminals.jl:140
at /Users/bussonniermatthias/.julia/REPL/src/REPL.jl:108
at /Users/bussonniermatthias/IJulia.jl/src/IJulia.jl:12
at /Users/bussonniermatthias/IJulia.jl/src/kernel.jl:3
solved by Pkg2.add("Color") ...
This is just a brainstorm, but I think it might be possible and desirable to remove explicit numpy dependence from both PyCall and from the Python package prototype here. This could be done by utilizing the PEP 3118 buffer interface. With it, any array-like object returned by PyCall could simply be some sort of new JuliaArray
object within Python. If the JuliaArray
object were to expose the buffer interface, then np.asarray(obj)
would automatically give a numpy array, with no data copying (where possible).
I think the PEP 3118 buffer struct should be easily mappable to the julia dense array specification, so the process should be pretty seamless. And any resulting JuliaArray
would essentially be usable in any function that accepts a numpy array -- as long as it calls np.asarray
on the input (which most libraries seem to do) -- but would also be much more general.
Removing the numpy dependency could lead to much cleaner code than is currently found in PyCall/numpy.jl
, and would lead to a much more general and flexible 2-way interface between Python array-like objects and Julia arrays. For example, it should be trivial to allow a JuliaArray
to be constructed on the Python side from any object exposing the buffer interface, and to then allow this memory buffer to be used directly in Julia.
In fact (and here I may be going off the deep end a bit) if the JuliaArray
and associated functions and methods were developed enough, it may even have the potential to replace numpy's functionality completely, without too much additional work, by relying on the functionality Julia already has in-place.
I've spent a bit of time browsing the code here and in PyCall, and I must admit I have no idea where one might start on making this change. Any thoughts?
Steves-MacBook-Pro:bin stevemoss$ ./julia-release-readline ~/Dropbox/Development/IJulia.jl/src/kernel.jl
ERROR: Context not defined
in include_from_node1 at loading.jl:92 (repeats 2 times)
in process_options at client.jl:274
in _start at client.jl:349
at /Users/stevemoss/Dropbox/Development/IJulia.jl/src/IJulia.jl:46
at /Users/stevemoss/Dropbox/Development/IJulia.jl/src/kernel.jl:3
Should this be ZMQContext? Do I have an outdated package somewhere? I built Julia from source and used Pkg2.add() to add all necessary packages!?
crash
message, how should we tell it we've shut down? And should we send a pyerr
message too?I'm trying to setup IJulia on an ubuntu server so that I can (hopefully) use it for a class this fall. I have a newly upgraded ubuntu 13.04, the latest julia from the nightly, a just pulled ipython and when starting the server run into this error:
<IDS|MSG>', '353865303465227d7b7d7b7d7b22657865637574696f6e5f7374617465223a22', '{"msg_id":"84789b85-032a-4452-9e37-542cbfecf504","msg_type":"status","username":"jlkernel","session":"ab40864a-610d-40ed-b5f1-d62a6c58e04e"}', '{}', '{}', '{"execution_state":"starting"}']
Traceback (most recent call last):
File "IPython/html/base/zmqhandlers.py", line 68, in _on_zmq_reply
msg = self._reserialize_reply(msg_list)
File "IPython/html/base/zmqhandlers.py", line 51, in _reserialize_reply
msg = self.session.unserialize(msg_list)
File "IPython/kernel/zmq/session.py", line 798, in unserialize
raise ValueError("Invalid Signature: %r" % signature)
ValueError: Invalid Signature: '353865303465227d7b7d7b7d7b22657865637574696f6e5f7374617465223a22'
I'm having trouble googling for a similar issue. I'm guessing it is pyzmq related, but am not sure. Here is what setup.py reports:
BUILDING IPYTHON
python: 2.7.4 (default, Apr 19 2013, 18:32:33) [GCC 4.7.3]
platform: linux2
OPTIONAL DEPENDENCIES
sphinx: 1.2b1
pygments: 1.6
nose: 1.3.0
pexpect: 2.4
pyzmq: 2.2.0.1
tornado: 3.1
readline: yes
jinja2: 2.7
Any help would be appreciated.
Right now we have lots of debugging println
statements that echo all ZMQ messages and other information to the terminal. As "IJulia" is rapidly approaching a real release, it would be good to turn this off by default soon, with an option to turn it back on of course.
I think @StefanKarpinski knows where the hooks are for this.
We should use @loladiro's new redirect_stdin
request to turn STDIN
into a zmq socket: when something is trying to read from stdin, we send an input_request
to the front-end, and write the resulting input_reply
(which will apparently be sent one line at a time) to stdin.
Update: readline(STDIN)
works in IJulia, but it's just a hack; other stdin reads won't work.
@JeffBezanson and I discussed this with @fperez over dinner on Thursday night.
Although we want to prominently credit the IPython project, calling this "Julia+IPython" or "Julia-IPython" or any similar combination is just going to cause endless confusion, because many people will think we are writing a Python dialect.
The best I could come up with was IJulia.
cc: @StefanKarpinski, @ViralBShah
PS. Eventually, the package to call Julia from Python (which is entirely distinct from the pure-Julia kernel for the IPython front-end), should be split off into its own repo and made a proper Python package.
Since ipython/ipython@0f43d86 IPython uses SHA-256 by default, which causes IJulia to croak.
I saved one of my DataFrames demos as an ipynb and uploaded it to nbviewer:
http://nbviewer.ipython.org/6199529
In the process, I find that the axes labels went missing. In any case, it was a lot of fun trying this out, and I loved the experience.
I am able to correctly use ipython (notebook, qtconsole and console), as well as the standard julia console, but cannot open IJulia in any. The error is in this gist, and looks like it's unable to open kernel.jl
Julia Version 0.2.0-prerelease+3595 Commit c0e861a*
IPython 1.0.0
[I opened issue #56, but think I got that problem fixed]
I am able to correctly use ipython (notebook, qtconsole and console), as well as the standard julia console, but cannot open IJulia in any. The python stacktrace is in this gist, and seems to be looking for a non-existing file.
Julia Version 0.2.0-prerelease+3254
IPython 1.0.0
We aren't using %identifier
for anything in Julia right now, so it seems reasonable and useful to support IPython-like magics in any execute_request
whose code
starts with %
.
If I type Base.Coll
in the notebook and hit tab, it is replaced with Collections
, without the Base.
. @StefanKarpinski or @loladiro?
PS. There seems to be a stray print
statement in the tab-completion code, since it is printing various string fragments to stdout on my machine...
would be great have syntax highlighting and tab auto-indent work properly in the notebook cells. @fperez, where are the hooks for this?
To match clasical Julia REPL
julia> "foobar"
"foobar"
Returned string should be quoted.
Qtconsole :
In [1]: "foobar"
Out[1]: foobar
(same in notebook)
The IJulia logo is installed in ~/.ipython/profile_julia/static/base/images/ipynblogo.png
. However, Firefox apparently gets confused because this image file has the same name as the one used for the regular IPython profile.
In particular, if I run ipython notebook
and then ipython notebook --profile julia
(or vice versa), then the latter gets the former'sd image (or vice versa) unless I force images to reload (shift-click the reload button).
It would be good to store the history and make it accessible in Julia via Out
arrays (or Dict
s? @fperez, are the history indices always sequential?)
Do we also store the input expressions or strings as an In
array?
Note that we only store the final result of evaluating code blocks, and only if the output was not suppressed. e.g. we don't store the history if the code ended with ;
.
Currently, the qtconsole
front-end is broken because it is using a Python heuristic for detecting whether the statement is ended (i.e. whether starts a new line in the same cell or completes the cell and requests execution).
@fperez mentioned this issue, but I forget where he said it had to be fixed. (Somewhere in the front end, though, not in the back-end kernel.)
I was doing some DataFrames operations with timings, and the output of @time
is mixed up - part of it is above the DataFrames result, and part below.
In [13]: @time by(vl, :ps, nrow)
elapsed time: 0.
Out[13]:
247x2 DataFrame:
ps x1
[1,] 1 9158
[2,] 2 6873
[3,] 3 7669
[4,] 4 7958
[5,] 5 7930
[6,] 6 6749
[7,] 7 8552
[8,] 8 8615
[9,] 9 7304
[10,] 10 6301
[11,] 11 7628
[12,] 12 6276
[13,] 13 7883
[14,] 14 7632
[15,] 15 8988
[16,] 16 8165
[17,] 17 7087
[18,] 18 7322
[19,] 19 6290
[20,] 20 7065
:
[228,] 228 1386
[229,] 229 1869
[230,] 230 2400
[231,] 231 2306
[232,] 232 2239
[233,] 233 1954
[234,] 234 1791
[235,] 235 2294
[236,] 236 3015
[237,] 237 2163
[238,] 238 1908
[239,] 239 1606
[240,] 240 612
[241,] 241 700
[242,] 242 657
[243,] 243 844
[244,] 244 851
[245,] 245 831
[246,] 246 841
[247,] 247 717
966992028 seconds (35148304 bytes allocated)
Needs a standardized way in Julia for code to indicate output of non-text data.
Requires a bit of surgery to get matplotlib to use our new display
functionality in order to get inline plots.
A model here is provided by pylab/backend_inline.py
and the corresponding code in core/pylabtools.py
from IPython, as pointed out by @fperez
Right now, jlkernel does not work with IPython notebook because:
Probably depends on #3 as well.
The result is
$ ipython console --profile julia
Python 2.7.4 (default, Apr 19 2013, 18:28:01)
Type "copyright", "credits" or "license" for more information.
IPython 1.0.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.
IPython profile: julia
WARNING: gnome-keyring:: couldn't connect to: /run/user/bates/keyring-k2gP3b/pkcs11: No such file or directory
ERROR:root:Uncaught exception, closing connection.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pyzmq-13.1.0-py2.7-linux-x86_64.egg/zmq/eventloop/zmqstream.py", line 401, in _run_callback
callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pyzmq-13.1.0-py2.7-linux-x86_64.egg/zmq/eventloop/minitornado/stack_context.py", line 241, in wrapped
callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/ipython-1.0.0-py2.7.egg/IPython/kernel/channels.py", line 169, in _handle_recv
self.call_handlers(self.session.unserialize(smsg))
File "/usr/local/lib/python2.7/dist-packages/ipython-1.0.0-py2.7.egg/IPython/kernel/zmq/session.py", line 798, in unserialize
raise ValueError("Invalid Signature: %r" % signature)
ValueError: Invalid Signature: '343530333863227d7b7d7b7d7b22657865637574696f6e5f7374617465223a22'
ERROR:root:Uncaught exception, closing connection.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pyzmq-13.1.0-py2.7-linux-x86_64.egg/zmq/eventloop/zmqstream.py", line 427, in _handle_events
self._handle_recv()
File "/usr/local/lib/python2.7/dist-packages/pyzmq-13.1.0-py2.7-linux-x86_64.egg/zmq/eventloop/zmqstream.py", line 459, in _handle_recv
self._run_callback(callback, msg)
File "/usr/local/lib/python2.7/dist-packages/pyzmq-13.1.0-py2.7-linux-x86_64.egg/zmq/eventloop/zmqstream.py", line 401, in _run_callback
callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pyzmq-13.1.0-py2.7-linux-x86_64.egg/zmq/eventloop/minitornado/stack_context.py", line 241, in wrapped
callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/ipython-1.0.0-py2.7.egg/IPython/kernel/channels.py", line 169, in _handle_recv
self.call_handlers(self.session.unserialize(smsg))
File "/usr/local/lib/python2.7/dist-packages/ipython-1.0.0-py2.7.egg/IPython/kernel/zmq/session.py", line 798, in unserialize
raise ValueError("Invalid Signature: %r" % signature)
ValueError: Invalid Signature: '343530333863227d7b7d7b7d7b22657865637574696f6e5f7374617465223a22'
ERROR:tornado.application:Exception in I/O handler for fd <zmq.sugar.socket.Socket object at 0x3a0ab48>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/tornado/ioloop.py", line 672, in start
self._handlers[fd](fd, events)
File "/usr/local/lib/python2.7/dist-packages/tornado/stack_context.py", line 331, in wrapped
raise_exc_info(exc)
File "/usr/local/lib/python2.7/dist-packages/tornado/stack_context.py", line 302, in wrapped
ret = fn(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pyzmq-13.1.0-py2.7-linux-x86_64.egg/zmq/eventloop/zmqstream.py", line 427, in _handle_events
self._handle_recv()
File "/usr/local/lib/python2.7/dist-packages/pyzmq-13.1.0-py2.7-linux-x86_64.egg/zmq/eventloop/zmqstream.py", line 459, in _handle_recv
self._run_callback(callback, msg)
File "/usr/local/lib/python2.7/dist-packages/pyzmq-13.1.0-py2.7-linux-x86_64.egg/zmq/eventloop/zmqstream.py", line 401, in _run_callback
callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pyzmq-13.1.0-py2.7-linux-x86_64.egg/zmq/eventloop/minitornado/stack_context.py", line 241, in wrapped
callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/ipython-1.0.0-py2.7.egg/IPython/kernel/channels.py", line 169, in _handle_recv
self.call_handlers(self.session.unserialize(smsg))
File "/usr/local/lib/python2.7/dist-packages/ipython-1.0.0-py2.7.egg/IPython/kernel/zmq/session.py", line 798, in unserialize
raise ValueError("Invalid Signature: %r" % signature)
ValueError: Invalid Signature: '343530333863227d7b7d7b7d7b22657865637574696f6e5f7374617465223a22'
Starting kernel event loops.
and then the process hangs.
Suggestions welcome. On reflection it may have something to do with my running Ubuntu with the "awesome" window manager. I sometimes get similar error messages about being unable to connect to the keyring from other processes.
I will switch to the standard window manager and see if that helps.
Hi,
Fresh julia install and IPython profile, I got that :
$ ipython qtconsole --profile=julia
Warning: could not import Readline.history_search into REPL
WARNING: delete!(a::Vector,x) is deprecated, use splice!(a,x) instead.
in library_dependency at /Users/bussonniermatthias/.julia/BinDeps/src/dependencies.jl:53
Traceback (most recent call last):
File "/Users/bussonniermatthias/ipython/IPython/qt/base_frontend_mixin.py", line 138, in _dispatch
handler(msg)
File "/Users/bussonniermatthias/ipython/IPython/qt/console/ipython_widget.py", line 207, in _handle_history_reply
for _, _, cell in history_items:
ValueError: too many values to unpack
Not sure if it's a problem in our message spec, or in julia implemntation, or a bug in qtconsole. Will cross post to IPython.
@fperez, the first message we get from an IPython client seems to be:
RECEIVED IPython Msg [ idents 5b500847-2c39-4646-9767-dc176e6d6fe0 ] {
header = ["msg_type"=>"execute_request","date"=>"2013-07-24T13:23:59.664489","msg_id"=>"4ffd7ba7-e21f-4c57-8242-70803ab8752d","username"=>"stevenj","session"=>"5b500847-2c39-4646-9767-dc176e6d6fe0"],
metadata = Dict{String,Any}(),
content = ["user_variables"=>{},"store_history"=>true,"silent"=>true,"code"=>"1","user_expressions"=>Dict{String,Any}(),"allow_stdin"=>true]
}
This is even before the user has entered anything, so the code=1
is some kind of ping from IPython. How are we supposed to handle this? Are there any other circumstances where we would receive "ping" messages?
Currently, we treat it as if the user entered it, which is not right, and leads to console output like:
In [2]: 1+2
Out[1]: 1
Out[2]: 3
In [3]: 3
Out[3]: 3
PS. If IPython wants to ping the kernel, why doesn't it just send a status
message rather than a bogus execute_request
?
Currently, the jlkernel does no signatures of its ZMQ messages, and therefore only supports profiles with empty key
fields.
To fix this, we need to implement the hmac
function in msg.jl
. In the short run, we can just use PyCall to call Python's hmac library, although in the long run it would be good to have better "native" support for digital signatures (probably via an external C library).
Note that IPython currently uses the default Python hmac, which is MD5, but after our discussion last night they will probably change this to SHA-2, and add a field to the profile to indicate what digest algorithm is used.
Currently, if you try to connect to a qtconsole, the kernel hangs while waiting for the first message (normally, it gets an execute_request
right away).
Specifically, it gets the identity header of the first message, and ZMQ indicates that more is to come, but then the next recv hangs (which @minrk says should not be possible if ZMQ said there was more of the message).
This could be a bug in our ZMQ wrappers, possibly with the asynchronous stuff that @loladiro recently added. ping @aviks.
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.