quinnj / Sublime-IJulia

An IJulia Frontend for Sublime Text 3
90 stars 16 forks source link

Trying to start IJulia Console: ***Kernel Died*** #60

Open GregPlowman opened 10 years ago

GregPlowman commented 10 years ago

Hi, I followed the procedure for installing Sublime-IJulia, but ran into the (apparently well-known) _Kernel Died_ problem.

• Windows 8.1 64-bit • Julia v0.3.0 • Sublime Text Build 3065 (unregistered)

When I select "Sublime-IJulia: Open New IJulia Console” from the command palette, I get the following message in a new document titled “IJulia 1” _Kernel Died_

In the console, I get:

Starting IJulia backend... Command Executed: C:/Program Files/Julia-0.3.0/bin/julia.exe C:\Users\Greg/.julia/v0.3/IJulia/src/kernel.jl "C:\Users\Greg\AppData\Roaming\Sublime Text 3\Packages/User/profile-1.json" Heartbeat didn't get a response Heartbeat didn't get a response Heartbeat didn't get a response Heartbeat didn't get a response Heartbeat didn't get a response Kernel died, closing sockets.... Sockets closed...

I edited IJulia.jl, to turn on verbose mode (line 4: verbose = true) and then executed the same command from the windows command prompt:

“C:/Program Files/Julia-0.3.0/bin/julia.exe” C:\Users\Greg/.julia/v0.3/IJulia/src/kernel.jl "C:\Users\Greg\AppData\Roaming\Sublime Text 3\Packages/User/profile-1.json"

I get the following output before returning back to the windows command prompt (presumably the kernel died):

PROFILE = ["key"=>"","transport"=>"tcp","ip"=>"127.0.0.1","hb_port"=>5685,"shell _port"=>5686,"control_port"=>5684,"stdin_port"=>5683,"iopub_port"=>5687]

If I execute the same command without the second argument (the ".../profile-1.json" argument to kernel.jl):

C:\Users\Greg>"C:/Program Files/Julia-0.3.0/bin/julia.exe" C:\Users\Greg/.julia /v0.3/IJulia/src/kernel.jl

I get the following output and the command prompt does not return (presumable the kernel is running):

connect ipython with --existing C:\Users\Greg/profile-5192.json SENDING IPython Msg [ idents status ] { header = ["msg_id"=>"084e8fbd-2b10-48e3-9db0-5d1a8819d725","msg_type"=>"status ","username"=>"jlkernel","session"=>"????"], metadata = Dict{String,Any}(), content = ["execution_state"=>"starting"] } Starting kernel event loops.

Can you help me, or shed any light on this issue. Would really like to get an editor or IDE to work with Julia. Thanks, Greg

davidheart commented 9 years ago

I also have some problems. ZMQ version 1.XXX is installed while executing Pkg.add("ZMQ"). I dunno how to upgrade up to 2.0 version as you mentioned as a requirement.

Can you answer me?

Thanks,

quinnj commented 9 years ago

Really sorry to not have responded sooner (grad school.....). Happy to help troubleshoot if needed.

GregPlowman commented 9 years ago

Yes, I would really like to get this working, but not sure where to start. Is there anything I can do to diagnose or hone in on the problem?

shamiltonian commented 9 years ago

Hi, I've been trying to get Sublime working with Julia all day but to no avail. My ZMQ file is correctly located at: /usr/local/lib/libzmq.dylib. Julia is in my path, so that when I type "julia" into the terminal, Julia loads up perfectly. I edited the user settings in Sublime to correctly specify the location of ZMQ as suggested. I also have the latest version of Sublime 3 installed. But when I try to open Julia from within Sublime, I get the "Kernel Died" message within a "* ljulia 1 *" tab. When I run the relevant command:

julia /Users/stevenhamilton/.julia/v0.3/IJulia/src/kernel.jl "/Users/stevenhamilton/Library/Application Support/Sublime Text 3/Packages/User/profile-1.json"

from within the terminal, I get the following output, with no progress:

Brias-MacBook-Air:~ stevenhamilton$ julia /Users/stevenhamilton/.julia/v0.3/IJulia/src/kernel.jl "/Users/stevenhamilton/Library/Application Support/Sublime Text 3/Packages/User/profile-1.json" Starting kernel event loops.

Any help you could lend would be greatly appreciated.

quinnj commented 9 years ago

Hmmm....interesting. One thing I noticed while going through my own setup recently on OSX was how fragile all the paths were. I had to explicitly specify the full absolute paths of pretty much everything to get it to work. I would try the full absolute path of your julia executable. I'm also going to look into making all that path handling code a little more friendly/robust. Let me know if that helps.

On Tue, Feb 3, 2015 at 7:28 PM, shamiltonian notifications@github.com wrote:

Hi, I've been trying to get Sublime working with Julia all day but to no avail. My ZMQ file is correctly located at: /usr/local/lib/libzmq.dylib. Julia is in my path, so that when I type "julia" into the terminal, Julia loads up perfectly. I edited the user settings in Sublime to correctly specify the location of ZMQ as suggested. I also have the latest version of Sublime 3 installed. But when I try to open Julia from within Sublime, I get the "Kernel Died" message within a "ljulia 1" tab. When I run the relevant command:

julia /Users/stevenhamilton/.julia/v0.3/IJulia/src/kernel.jl "/Users/stevenhamilton/Library/Application Support/Sublime Text 3/Packages/User/profile-1.json"

from within the terminal, I get the following output, with no progress:

Brias-MacBook-Air:~ stevenhamilton$ julia /Users/stevenhamilton/.julia/v0.3/IJulia/src/kernel.jl "/Users/stevenhamilton/Library/Application Support/Sublime Text 3/Packages/User/profile-1.json" Starting kernel event loops.

Any help you could lend would be greatly appreciated.

— Reply to this email directly or view it on GitHub https://github.com/quinnj/Sublime-IJulia/issues/60#issuecomment-72779133 .

shamiltonian commented 9 years ago

Thanks so much for your prompt reply.

I changed "julia" to "/Applications/Julia-0.3.5.app/Contents/Resources/julia/bin/julia" in the sublime user settings page, et voila, the Julia title loads in Sublime.

However, when I go to run a simple script in another tab (with "Julia" displayed in the bottom RHS of the window), I get the following error message:

[Errno 2] No such file or directory: 'julia' [cmd: ['julia', '/Users/stevenhamilton/Dropbox/...']] [dir: /Users/stevenhamilton/Dropbox/...] [path: /usr/bin:/bin:/usr/sbin:/sbin] [Finished]

My sense is that in the command line there, there should be no inverted commas around "julia", and then no comma before the filename. (Indeed, when I make these changes and post into terminal, it works perfectly). Or am I doing something stupid? Thanks for your continued help!

GregPlowman commented 9 years ago

Finally, after much playing around, I managed to get Sublime-IJulia working on Windows.

Seems some file paths are processed differently. (Maybe some by Windows directly, others by Julia with some parsing?).

In any case, care needs to be taken with file paths on Windows:

I played around with many combinations and got really confused. However I think the Julia executable path should be absolute, quoted (if spaces in path name) and use backslashes. ZMQ and kernel pathnames can be relative, should be unquoted, and use forward slash separator.

Here's the Windows extract from Sublime user settings file that worked for me:

"windows": {
    "zmq_shared_library": "~/.julia/v0.3/ZMQ/deps/usr/lib/libzmq.dll",      
    "commands": [
        {
            "command_name": "default",
            "julia": "\"C:\\Program Files\\Julia-0.3.5\\bin\\julia.exe\"",
            "julia_args": "",
            "ijulia_kernel": "~/.julia/v0.3/IJulia/src/kernel.jl"
        }
    ]
}

Note that to quote path name use \", and to use backslash path separator use \\.

Cheers, Greg

sammorris81 commented 9 years ago

I was encountering the same build issue mentioned by shamilton on the mac, and was able to fix it by installing Fix Mac Path. Although this addresses the issue for julia-build, you still need to fully specify the path to for the IJulia Console.

joseraulgonzalez commented 9 years ago

I was able to solve this issue on Mac OS 10.10 by running "which julia" on the terminal and copying the output to the "julia" field under "osx" in my Sublime-Ijulia user configuration file. I hope this helps others.

rpoddighe commented 9 years ago

I built Julia from source and added a symlink to /usr/local/bin to get Julia in my PATH (first suggestion in README.md). If you do this, make sure you don't point "julia" in the settings to the symlink, but to the executable directly:

"osx": {
    "zmq_shared_library": "~/.julia/v0.3/Homebrew/deps/usr/lib/libzmq.dylib",
    "commands": [
        {
            "command_name": "default",
            "julia": "/path/to/julia_repo/usr/bin/julia",
            "julia_args": "",
            "ijulia_kernel": "~/.julia/v0.3/IJulia/src/kernel.jl"
        }

This worked for me.

nickleeh commented 9 years ago

@GregPlowman Your solution works! Thank you very much indeed!

anuraag94 commented 9 years ago

I am on mac 10.10, and I have tried all of the suggested advice but I'm still encountering the same error. my file paths are all specified in full:

"osx": {
    "zmq_shared_library": "~/.julia/v0.3/Homebrew/deps/usr/lib/libzmq.dylib",
    "commands": [
        {
            "command_name": "default",
            "Julia" : "/Applications/Julia-0.3.9.app/Contents/Resources/julia/bin/julia",
            "julia_args": "",
            "ijulia_kernel": "~/.julia/v0.3/IJulia/src/kernel.jl"
        }
    ]
},

Would appreciate any advice

ulzegasi commented 9 years ago

Hi, I am on a MacBook Pro, OSX 10.8.5, and have set all the paths,

"osx": {
    "zmq_shared_library": "~/.julia/v0.3/Homebrew/deps/usr/lib/libzmq.dylib",
    "commands": [
        {
            "command_name": "default",
            "julia": "/Applications/Julia-0.3.9 2.app/Contents/Resources/julia/bin/julia",
            "julia_args": "",
            "ijulia_kernel": "~/.julia/v0.3/IJulia/src/kernel.jl"
        }
    ]
},

but I still get the "Kernel died" message. Any help would be very welcome.

ForrestGump commented 9 years ago

I have the same problem on WinXP, Sublime 3 (3083), Julia 0.4 My settings:

"windows": {
    "zmq_shared_library": "~/.julia/v0.4/WinRPM/deps/usr/i686-w64-mingw32/sys-root/mingw/bin/libzmq.dll",
    "commands": [
        {
            "command_name": "default",
            "julia": "\"D:\\Program Files\\Julia-0.4.0\\bin\\julia.exe\"",
            "julia_args": "",
            "ijulia_kernel": "~/.julia/v0.4/IJulia/src/kernel.jl"
        }
    ]
}

And I have error:

Starting IJulia backend...
Command Executed: "D:\Program Files\Julia-0.4.0\bin\julia.exe"  C:\Documents and Settings\user/.julia/v0.4/IJulia/src/kernel.jl "D:\Program Files\Sublime Text 3 (3083)\Data\Packages/User/profile-2.json"
Heartbeat didn't get a response
Heartbeat didn't get a response
Heartbeat didn't get a response
Heartbeat didn't get a response
Heartbeat didn't get a response
Kernel died, closing sockets....
Sockets closed...