Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sublime-IJulia: Julia kernel starts but cannot get the IJulia plugin #74

Open
ulzegasi opened this issue Sep 15, 2015 · 15 comments
Open

Comments

@ulzegasi
Copy link

Hi there,

I am on Windows 7 64bit, with both Julia and Sublime Text 3 64bit versions. I am pretty sure I have set the paths correctly:

"windows": {
"zmq_shared_library": "C:/Users/ulzegasi/.julia/v0.3/WinRPM/deps/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libzmq.dll",
"commands": [
    {
        "command_name": "default",
        "julia": "julia.exe",
        "julia_args": "",
        "ijulia_kernel": "C:/Users/ulzegasi/.julia/v0.3/IJulia/src/kernel.jl"
    }
]
}

Note that julia.exe is in the PATH (I can run julia directly from command line).
When I open a new Julia console in Sublime, the julia kernel starts (as confirmed in the task manager) but the IJulia plugin does not work. Everything stays blank forever.
I have already replaced the libraries libstdc++-6.dll and libgcc_s_seh-1.dll in the Sublime windeps directory as suggested elsewhere.
Instead of the IJulia plugin I get the message:

Starting IJulia backend...
Command Executed: julia.exe  C:/Users/ulzegasi/.julia/v0.3/IJulia/src/kernel.jl      "C:\Users\ulzegasi\AppData\Roaming\Sublime Text 3\Packages/User/profile-1.json"
Exception in thread Thread-4:
Traceback (most recent call last):
  File "./threading.py", line 901, in _bootstrap_inner
  File "C:\Users\ulzegasi\AppData\Roaming\Sublime Text 3\Packages\IJulia\Kernel.py", line 412, in run
    r = self.handlers.get(m, self.pyin_h)()
  File "C:\Users\ulzegasi\AppData\Roaming\Sublime Text 3\Packages\IJulia\Kernel.py", line 378, in stdout_h
    data = self.get_stdout()
  File "C:\Users\ulzegasi\AppData\Roaming\Sublime Text 3\Packages\IJulia\Kernel.py", line 328, in get_stdout
    data = m.content['data']
KeyError: 'data'

How can I fix this? Thanks a lot for your help.

@ulzegasi
Copy link
Author

I switched back to IJulia version 0.2.5 and everything works again. It seems the problem is in v1.0.

@disleyland
Copy link

Sublime-IJulia is lagging behind the IPython/Jupyter developments. Latest Pkg.update("IJulia") v.1 does in fact kill the Sublime-IJulia repl. As ulzegasi describes, the kernel starts but then sits there staying blank forever. Only by following the IJulia instructions for using older IPythons did i revive my use of Sublime again.
ie.

Pkg.checkout("IJulia", "ipython2")
Pkg.build("IJulia")

Yeah, sublime is back in business again. but unfortunately, trying to launch julia via an ipython/juptyer session now crashes the kernel immediately.

If Sublime-IJulia doesn't keep up, seem everyone will have to choose which environment you want to work with most.

@clee115
Copy link

clee115 commented Oct 12, 2015

I had the same exact problem in a fresh build of Sublime and Julia in OS X. I tried to revert to IJulia 0.2.5 using the command

Pkg.pin("IJulia",v"0.2.5")

Are there additional instructions for reverting? Any help would be appreciated.

Here is my Julia version& Sys info

Thanks!

Julia Version 0.4.0 (2015-10-08 06:20 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin13.4.0)
OSX Yosemite Version 10.10.5
MacBook Pro (Retina, Late 2013)
Processor 2.8 GHz Intel Core i7 w 16 GB of Memory
Python: (2.7.0) Tried both the Standard version that came with OS X and also tried with Anaconda, both didn't work.

@ulzegasi
Copy link
Author

@clee115 , have you tried Julia version 0.3.9? On my MacBook Pro (mid 2009, OSX 10.8) it works with IJulia pinned to v0.2.5. I am using Anaconda, Python 2.7.

@clee115
Copy link

clee115 commented Oct 15, 2015

@ulzegasi, I didn't try this on Julia 0.3.9, but I tried this on 0.3.11 (latest binary available), and I finally got it working. Version 0.4.0 works as well. What's weird is that when I start Sublime, the very first console that I open will not display anything, and only when I open the console (with cmd+shift+p) the second time will the julia logo actually show up. This works with subsequent consoles that I open as well. Not sure why this is, but attached is my screen shot and specific sublime-console errors:

image

The screens in order from the left to the right: 1) test.jl, 2) first console: blank & gave the "KeyError: 'data'", 3) second console: it works, 4) third console: it also works.

I've replicated this behavior on two machines:

Machine 1 (MacPro Late 2013 with OS X Yosemite 10.10.5):
Julia 0.4.0
ZMQ: 0.3.0
IJulia: 0.2.5 pinned.
Python: standard OSX. v. 2.7.10 with GCC 4.2.1 Apple LLVM

Machine 2 (MacBook Pro 2013 with OS X Yosemite 10.10.5):
Julia 0.3.9
ZMQ: 0.2.0
IJulia: 0.2.5 pinned.
Python: Python v 2.7.10 | Anaconda 2.3.0 (x86_64)

Hopefully this is helpful for anyone who is out there struggling with the same problems. Would love to hear if there is a permanent fix to this.

@jandehaan
Copy link

Same issue. Windows7. Installed everything from scratch today (10/31/2015): Julia 4.0 (64 bit), Sublime Text 3.0 (build 3083). Followed Sublime-IJulia installation instruction to the letter. Sublime Text reports that IJulia kernel is working... but no Julia banner, no response to Shift+Enter;
Jacob, you must a very busy man, but when your schedule allows, please make Sublime-IJulia compatible with Julia 4.0. Your fans will greatly appreciate it.
Thanks.

@sanghmitragautam
Copy link

I had the same problem solved it by following @disleyland suggestion. However now on sublime it takes console number 3 to finally get Julia to launch. The first console is blank (with the Key error: data message in the console). Second Kernel Died and finally Julia banner launches in the 3rd console. This pattern has been consistent for the last 5 sessions. Wondering if anyone has faced the same issue and/or found a possible fix? Thanks very much

@lzoeckle
Copy link

lzoeckle commented Feb 2, 2016

For anyone who is still having an issue:

Go into the Kernel.py file (\Users\name\AppData\Roaming\Sublime Text 3\Packages\IJulia\Kernel.py on Windows), and change line 328 from:

data = m.content['data']

to

data = m.content['text']

Believe it or not, this bug is an issue with how the Julia banner is displayed...

@sanghmitragautam
Copy link

Thanks @lzoeckle, I now get the following error upon trying to open a Julia console:
error: plugin_host has exited unexpectedly, plugin functionality won't be available until Sublime Text has been restarted
After this error the option to select Sublime: IJulia using cmd+shift+p disappears and can only be restored with a system restart. I really appreciate any help with the matter, thank you.
Julia 0.3.7
ZMQ: 0.2.0 pinned.
IJulia: 0.2.5 pinned.

@lzoeckle
Copy link

lzoeckle commented Feb 2, 2016

@sanghmitragautam I would say first make sure that your ZMQ directory is correct (using ZMQ; ZMQ.zmq in Julia). If it is and you're still running into this problem, try copying two .dll files (libgcc_s_seh-1.dll and libstdc++-6.dll) from your Julia install directory to your windeps directory (.../Sublime Text 3/Packages/IJulia/windeps/). There should be two .dll files already there with the same names as the files you're replacing them with. Don't worry about that and replace them. If you're on a mac, I'm not 100% sure if this fix is even applicable. There might be .dylib files named libgcc_s.1.dylib and libstdc++.6.dylib in your Julia install directory. If there are, move them to your windeps directory.

If none of this works, I would consider updating your installation of IJulia (essentially reverting what disleyland did) and trying again. Now that the KeyError issue is resolved there's no reason to have an outdated version.

@sanghmitragautam
Copy link

@lzoeckle thank you so much. I do apologize but I have followed the above process including replacing the files. I was successfully using sublime with julia until 2 days ago. The breakdown happened when I performed a Pkg.update() on julia and sublime Ijulia plugin stopped to work. I manually pinned IJulia and ZMQ packages to older versions hoping that would solve the problem. Now I am stuck with the following error:
error: plugin_host has exited unexpectedly, plugin functionality won't be available until Sublime Text has been restarted
I understand that this error arises in general when a certain plugin malfunctions (not just an Ijulia issue). I am really sorry all but thanks for your patience.
Julia 0.3.7
ZMQ: 0.2.0 pinned.
IJulia: 0.2.5 pinned.

@lzoeckle
Copy link

lzoeckle commented Feb 2, 2016

@sanghmitragautam The error you got 2 days ago was KeyError: 'data', correct? I think your best bet is unpinning IJulia and ZMQ, updating them, and then fixing the line of code in the kernel.py file again. If that doesn't work I'm afraid I'm out of ideas! Best of luck.

@moynext
Copy link

moynext commented Feb 9, 2016

Thanks @lzoeckle, i have solved the main trouble on linux, changing line 328, but now it doesn't appear the results in the julia prompt, do you have any idea?

@joshiain
Copy link

@moynext I have the same issue as you after changing line 328. I'm on osx.

@fdennig
Copy link

fdennig commented Jun 27, 2017

@moynext I have the same problem. now I have a julia logo, having changed line 328, but now the the ijulia prompt does not actualy show any results
anyone have any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants