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

global name 'zmq' is not defined #64

Open
M-Marz opened this issue Feb 21, 2015 · 11 comments
Open

global name 'zmq' is not defined #64

M-Marz opened this issue Feb 21, 2015 · 11 comments

Comments

@M-Marz
Copy link

M-Marz commented Feb 21, 2015

Hi,

I`m trying to install Sublime-IJulia and I´m running into troubles. I read a couple of related threads but I couldn´t find a solution...

I added ZMQ and IJulia. ZMQ built successfully IJulia not, since I don´t have IPhython installed.
This is my settings file:

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

If I run "Sublime-IJulia: Open New IJulia Console", I get the following:

Starting IJulia backend...
Command Executed: "C:\Users\acer-touch\AppData\Local\Julia-0.3.6\bin\julia.exe" C:\Users\acer-touch/.julia/v0.3/IJulia/src/kernel.jl "C:\Users\acer-touch\AppData\Roaming\Sublime Text 3\Packages/User/profile-19.json"
Traceback (most recent call last):
File "C:\Users\acer-touch\AppData\Roaming\Sublime Text 3\Packages\IJulia\IJulia.py", line 51, in start_kernel
self.kernel = Kernel.Kernel(self.id,self.cmd,self)
File "C:\Users\acer-touch\AppData\Roaming\Sublime Text 3\Packages\IJulia\Kernel.py", line 245, in init
self.context = Context()
File "C:\Users\acer-touch\AppData\Roaming\Sublime Text 3\Packages\IJulia\Kernel.py", line 112, in init
self.ptr = zmq.zmq_ctx_new()
NameError: global name 'zmq' is not defined

My paths should be correct and I used absolute paths...
What is wrong?

Thank´s a lot for any help!

@quinnj
Copy link
Owner

quinnj commented Feb 21, 2015

It looks like it's not finding your ZMQ library. First I would try restarting sublime, since the ZMQ library is opened/located when sublime starts. If it's not found when you restart sublime, it should popup and tell you. You'll then want ot fire up Julia and run using ZMQ; ZMQ.zmq and copy the resulting path to your ZMQ library into the zmq_shared_library command in your Sublime-IJulia settings. I think your Julia command path doesn't need the extra quoting either, just "C:\Users\acer-touch\AppData\Local\Julia-0.3.6\bin\julia.exe" should be sufficient.

@M-Marz
Copy link
Author

M-Marz commented Feb 21, 2015

I deleted the extra quoting and did using ZMQ; ZMQ.zmq; the resulting path is the one I used in the settings file:
"C:\Users\acer-touch.julia\v0.3\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\libzmq.DLL"

When I restart Sublime the following error pops up:
plugin_host.exe Entry Point Not Found
The procedure entry point "_ZSt24_throw_out_of_range_fmtPKcz" could not be located in the dynamic link library "C:\Users\acer-touch.julia\v0.3\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\libzmq.DLL"

It looks as if I made a typo, but I checked it 1000times..

@quinnj
Copy link
Owner

quinnj commented Feb 21, 2015

Hmmm....that's a pretty weird error. It almost seems like your library is out of date or something, but that shouldn't be the case when it's being installed automatically. Hmmm, I'll have to brainstorm some other things to try.

@tildebyte
Copy link

Same error, different lib:

---------------------------
plugin_host.exe - Entry Point Not Found
---------------------------
The procedure entry point _ZSt24__throw_out_of_range_fmtPKcz could not be located in the dynamic link library libstdc++-6.dll. 

Also, this S.O. question?

@tildebyte
Copy link

Answering my own question:
libstdc++-6.dll exists in 2 places: Sublime Text 3 Beta\Data\Packages\IJulia\windeps and .julia\v0.3\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin.
i.e., the version shipping with the plugin doesn't match the one libzmq is linked against. I fixed it by copying down ZMQ's libstdc DLL from mingw\bin into the plugin's windeps dir.
So, yes, I concur: @M-Marz libzmq is probably mismatched to the plugin OR he's got another libzmq somewhere in the path, which ST is finding first.

@M-Marz
Copy link
Author

M-Marz commented Feb 27, 2015

@tildebyte That works! Thank you very much!

@Ken-B
Copy link

Ken-B commented Apr 1, 2015

@tildebyte same problem here, I removed the dll in windeps and now it works, thanks a lot for the fix!

@androdri1
Copy link

@tildebyte same proble, same solution. Thanks!

@nickleeh
Copy link

@tildebyte I got the same problem, when I copy the libstdc++-6.dll to the sublime deps, I got kernel died. Any clue?

@sanghmitragautam
Copy link

@tildebyte same problem, solution worked Thank you!

@denniscote-work
Copy link

@tildebyte same problem. My windeps dir was in a different location, but copying the mingw32 libstdc++-6.dll file there worked. Thanks.

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

8 participants