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

Win64, 'ZMQ' not defined or plugin_host crash #32

Closed
pfitzseb opened this issue Feb 20, 2014 · 12 comments
Closed

Win64, 'ZMQ' not defined or plugin_host crash #32

pfitzseb opened this issue Feb 20, 2014 · 12 comments

Comments

@pfitzseb
Copy link

Hey there,
when there are some errors I'm encountering when I'm trying to install/tun IJulia in Sublime Text.
Im on 64bit Windows 8.1 here and tried both the x64 and x86 versions of ST3 - with different problems.
ZMQ and IJulia are installed.

x86:
Installation of the PluginManager and the IJulia-Plugin works flawlessly, but when I try to start a new IJulia notebook, following error occurs:

OSError: [WinError 193] %1 is not a valid Win32 application
...
NameError: global name 'zmq' is not defined

And yes, I have set the path to the libzmq.dll and the kernel.jl and the julia-readline.exe properly.
This error has been mentioned in #26, but not resolved, so I thought I'd ask again.

x64:
Installation of the Plugin Manager works, but the IJulia-Plugin cannot be installed due to a missing .dll (libgcc_s_seh-1.dll).

OSError: [WinError 126] The specified module could not be found

That was already mentioned in #11 and is no error with Sublime-Julia per se, but with the plugin_host.exe that comes withST3 and I can actually isntall other plugins without plugin_host crashing.
I have not clue how to resolve that error - or rather how to get that .dll... it's nowhere to be found on the Internet and a mingw installation didn't change anything. But then I don't know much about mingw and all that stuff.
I have actually found that dll and another one that was missing to (libstdc++-6.dll) in the Julia install dir and copied them into my installation of ST3. But yeah, another error:

Starting IJulia backend...
Starting IJulia backend...
Command Executed: D:/Programme/Julia 0.3.0-prerelease/bin/julia-readline.exe  C:/Users/Basti/.julia/IJulia/src/kernel.jl "D:\Programme\SublimeText3\Data\Packages/User/profile-0.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...
error: plugin_host has exited unexpectedly, plugin functionality won't be available until Sublime Text has been restarted

So I'm guessing that the dlls were the wrong version or something, but as I said: I don't know that much about ST, IJulia and all that good stuff, so I'm kinda clueless as how to proceed now. Hope someone can help me a bit. :)

@quinnj
Copy link
Owner

quinnj commented Feb 20, 2014

Ok, I just pushed a fix that hopefully resolves this. Usually it's best if you remove then re-install Sublime-IJulia (ctrl+shift+p, Remove Package, IJulia) to see the fix.

@pfitzseb
Copy link
Author

Thanks for the fast reply!
I reinstalled ST and deleted the folders in AppData/Roaming and AppData/Local, but it's still not working.
But I think thats because you forgot a debug flag (KernelManager.py, row 214) and because of that it throws an FileNotFoundError:

Traceback (most recent call last):
  File "IJulia in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 53, in start_kernel
  File "KernelManager in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 215, in __init__
  File "KernelManager in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 59, in zmq_profile
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/karbarcca/AppData/Roaming/Sublime Text 3/Packages/IJulia/profile-1.json'

And there are two more errors I only just noticed (x64 ST):

Traceback (most recent call last):
  File "D:\Programme\Sublime Text 3\sublime_plugin.py", line 157, in on_api_ready
    m.plugin_loaded()
  File "KernelManager in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 22, in plugin_loaded
  File "X/ctypes/__init__.py", line 431, in LoadLibrary
  File "X/ctypes/__init__.py", line 353, in __init__
OSError: [WinError 126] The specified module could not be found
Package Control: Skipping automatic upgrade, last run at 2014-02-20 19:13:02, next run at 2014-02-20 20:13:02 or after
Traceback (most recent call last):
  File "D:\Programme\Sublime Text 3\sublime_plugin.py", line 231, in on_close
    callback.on_close(v)
  File "IJulia in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 439, in on_close
  File "IJulia in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 34, in julia_view
IndexError: list index out of range

I'll try it on the x86 version of ST again.

@quinnj
Copy link
Owner

quinnj commented Feb 20, 2014

Oops! I just pushed a new release that fixes the debug issue.

@pfitzseb
Copy link
Author

Okay, the debug-thingy is resolved now, but there are still some other errors:

Traceback (most recent call last):
  File "D:\Programme\Sublime Text 3\sublime_plugin.py", line 157, in on_api_ready
    m.plugin_loaded()
  File "KernelManager in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 16, in plugin_loaded
  File "X/ctypes/__init__.py", line 431, in LoadLibrary
  File "X/ctypes/__init__.py", line 353, in __init__
OSError: [WinError 126] The specified module could not be found
Traceback (most recent call last):
  File "D:\Programme\Sublime Text 3\sublime_plugin.py", line 231, in on_close
    callback.on_close(v)
  File "IJulia in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 439, in on_close
  File "IJulia in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 34, in julia_view
IndexError: list index out of range

This one occurs twice in a row ^.

Traceback (most recent call last):
  File "IJulia in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 53, in start_kernel
  File "KernelManager in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 228, in __init__
  File "KernelManager in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 104, in __init__
NameError: global name 'zmq' is not defined

And plugin_host.exe still crashes.
If I copy the dlls from the julia installdir into the sublime-text dir, it starts up properly but then crashes as in the first post.

The x86-version displays the same errors as in the first post, and an additional "list index out of bounds".

Maybe something got screwed up while I was reinstalling ST and the plugin, but I don't really think so... And the behavior ist consistent in the portable and installable versions.

@quinnj
Copy link
Owner

quinnj commented Feb 20, 2014

Ok, first of all, let's make sure you're getting the right bit versions across everything. I would say stick 64-bit all the way around, so make sure you only have windows 64-bit, julia 64-bit, ST3 64-bit. Really make sure there isn't any other 32-bit bit stuff that could possibly get linked/called in any way.

Once that's done. Are you sure that the ZMQ shared library got installed correctly? (note instructions on the home page). The above error sounds like it can't find your ZMQ library, so I would go back to the install instructions to make sure everything looks good.

@pfitzseb
Copy link
Author

Okay.
I have the Julia 0.3.0 64-bit build installed. ZMQ is installed and has build properly, IJulia was installed succesfully, but could not build (since there's no Python or IPython installed on this machine).
Then I (once again ;)) reinstalled ST3 64-bit, deleting everything related in AppData.
When I now try to install sublime-IJulia via the Package Manager, plugin_host.exe crashes (due to the missing dlls I mentioned above). That can be fixed if the dlls are copied from julia to ST3. The installation of sublime-IJulia seems to work, but the console shows the following error:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 115, in reload_plugin
    m.plugin_loaded()
  File "KernelManager in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 14, in plugin_loaded
TypeError: 'NoneType' object is not subscriptable

Now, if I change the paths in Sublime-IJulia.sublime-settings so that they match with the install-dirs on my machine, restart ST3 and then try to open a new IJulia Console, it shows

Starting IJulia backend...
Command Executed: D:/Programme/Julia 0.3.0-prerelease/bin/julia-readline.exe  C:/Users/Basti/.julia/IJulia/src/kernel.jl "C:\Users\Basti\AppData\Roaming\Sublime Text 3\Packages/User/profile-0.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...
error: plugin_host has exited unexpectedly, plugin functionality won't be available until Sublime Text has been restarted

So there appear to be no more problems with finding ZMQ, but only if the missing dlls are copied to the ST3 dir.
If not, then it is still throwing the errors mentioned in my last post...

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 157, in on_api_ready
    m.plugin_loaded()
  File "KernelManager in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 16, in plugin_loaded
  File "X/ctypes/__init__.py", line 431, in LoadLibrary
  File "X/ctypes/__init__.py", line 353, in __init__
OSError: [WinError 126] The specified module could not be found
Package Control: Skipping automatic upgrade, last run at 2014-02-20 20:25:57, next run at 2014-02-20 21:25:57 or after
Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 374, in on_text_command
    res = callback.on_text_command(v, name, args)
  File "IJulia in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 444, in on_text_command
  File "IJulia in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 34, in julia_view
IndexError: list index out of range
Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 231, in on_close
    callback.on_close(v)
  File "IJulia in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 439, in on_close
  File "IJulia in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 34, in julia_view
IndexError: list index out of range
Starting IJulia backend...
Command Executed: D:/Programme/Julia 0.3.0-prerelease/bin/julia-readline.exe  C:/Users/Basti/.julia/IJulia/src/kernel.jl "C:\Users\Basti\AppData\Roaming\Sublime Text 3\Packages/User/profile-0.json"
Traceback (most recent call last):
  File "IJulia in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 53, in start_kernel
  File "KernelManager in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 228, in __init__
  File "KernelManager in C:\Users\Basti\AppData\Roaming\Sublime Text 3\Installed Packages\IJulia.sublime-package", line 104, in __init__
NameError: global name 'zmq' is not defined

By the way, I really appreciate your help! :)

@quinnj
Copy link
Owner

quinnj commented Feb 26, 2014

Any update on this? Sorry for the delay, I've been swamped with school. I tried it out with the most recent Julia 0.3 binary and while I do see occasional crashes, it works for me most of the time.

@pfitzseb
Copy link
Author

No worries about the delay, I was busy with exams this week anyways.
So, I just reinstalled Windows... and installed Python 3.3.5, IPython, Julia 0.3.0, IJulia and sublime-IJulia.
Bad news: It's still not working.
Good news: There's only one error! Anything related to the OS seems to have vanished, now I'm only getting:

Starting IJulia backend...
Command Executed: D:/Programme/julia0.3/bin/julia-readline.exe  C:\Users\Basti/.julia/v0.3/IJulia/src/kernel.jl "C:\Users\Basti\AppData\Roaming\Sublime Text 3\Packages/User/profile-0.json"
error: plugin_host has exited unexpectedly, plugin functionality won't be available until Sublime Text has been restarted

So, yeah... still not sure why that's happening. My best guess: It's related to the .dlls I was mentioning earlier - I had to copy those (from the julia/bin-dir) into the ST3 install dir to get plugin-host.exe up and running. So, just to exclude that possibility: Would it be possible for you to point me to a better source for the .dlls?
Or don't they matter at all and something else is wrong?

@quinnj
Copy link
Owner

quinnj commented Feb 27, 2014

I'm actually debugging this as we speak. I finally managed to reproduce
this and it's related to the use of the windows binary (I can't reproduce
with any builds from source). I'll let you know what I figure out.

-Jacob

On Thu, Feb 27, 2014 at 1:54 PM, Varanas notifications@github.com wrote:

No worries about the delay, I was busy with exams this week anyways.
So, I just reinstalled Windows... and installed Python 3.3.5, IPython,
Julia 0.3.0, IJulia and sublime-IJulia.
Bad news: It's still not working.
Good news: There's only one error! Anything related to the OS seems to
have vanished, now I'm only getting:

Starting IJulia backend...
Command Executed: D:/Programme/julia0.3/bin/julia-readline.exe C:\Users\Basti/.julia/v0.3/IJulia/src/kernel.jl "C:\Users\Basti\AppData\Roaming\Sublime Text 3\Packages/User/profile-0.json"
error: plugin_host has exited unexpectedly, plugin functionality won't be available until Sublime Text has been restarted

So, yeah... still not sure why that's happening. My best guess: It's
related to the .dlls I was mentioning earlier - I had to copy those (from
the julia/bin-dir) into the ST3 install dir to get plugin-host.exe up and
running. So, just to exclude that possibility: Would it be possible for you
to point me to a better source for the .dlls?
Or don't they matter at all and something else is wrong?

Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-36276984
.

@quinnj quinnj closed this as completed in ef521ef Feb 27, 2014
@pfitzseb
Copy link
Author

Wohoo, it is actually working now! Thank you so much! :)
Although, a little bit of nitpicking: The binaries you included need to be copied into the Sublime Text 3 directory, otherwise plugin_host still crashes - so you might wanna include that in the installation instructions for windows (or automate it if possible).
Otherwise it's working flawlessly. 👍

@quinnj
Copy link
Owner

quinnj commented Feb 27, 2014

Hmmmm.....shouldn't have to copy them. I'm telling sublime to specifically look in the folder to find them. But glad it's working!

@wwkong
Copy link

wwkong commented Mar 1, 2015

@Varanas and @quinnj: Thanks for the solutions! I've been having the same issues as Varanas and the "moving the .DLL files" trick worked wonders on a fresh installation of Sublime-IJulia, iPython, and Julia (on 64-bit Windows 8, Julia v0.4.0-dev+3622).

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

3 participants