quinnj / Sublime-IJulia

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

Error loading syntax file "Packages/IJulia/Syntax/Julia.tmLanguage": Unable to open Packages/IJulia/Syntax/Julia.tmLanguage #4

Closed schuberm closed 11 years ago

schuberm commented 11 years ago

On trying to install/uninstall, this error pops up in ST3 OSX10.8

quinnj commented 11 years ago

Darn it, I really hate how Package Control chooses to install packages. It was much easier when users had to git clone the repo into their packages directory. I'll try to test this out and find a fix. I think it just involves getting the right path for osx/linux.

schuberm commented 11 years ago

So I reinstalled ST3 and Sublime-IJulia, and now the error does not appear on install/uninstall. I presume this is because of your recent commits. However, once julia is explicitly defined in Preferences->Package Settings->IJulia->Users, the option of opening the REPL does not appear in cmd+shift+p. I posted earlier in the julia-users group. Should I close and open an new issue?

quinnj commented 11 years ago

If the command doesn't show up, then there's some kind of plugin error. Open up a fresh sublime and after a second or two, press ctrl+backtick (backtick/tilde key). This opens up the sublime console to show any errors it had on loading plugins. You may have to scroll up a bit in the console, but you should see some error for IJulia. If you could post that here, that'd be great. I would imagine it's having a hard time finding your ZMQ library, which is a known issue right now for osx.

Just to confirm, you've already done Pkg.add("IJulia") from within julia, right? That ensures that you actually have a ZMQ library to link to. My plan is to automatically check this in the future, but for now, the user needs to install the IJulia Julia package first before trying to use the IJulia frontend in sublime.

schuberm commented 11 years ago

I have IJulia (ipython notebook --profile julia works). I see the ZMQ and IJulia directories in ~/.julia.

Here is the sublime console on load:

startup, version: 3047 osx x64 channel: stable
executable: /Applications/Sublime Text.app/Contents/MacOS/Sublime Text
working dir: /
packages path: /Users/mullspace/Library/Application Support/Sublime Text 3/Packages
state path: /Users/mullspace/Library/Application Support/Sublime Text 3/Local
hardware concurrency: 4
zip path: /Applications/Sublime Text.app/Contents/MacOS/Packages
zip path: /Users/mullspace/Library/Application Support/Sublime Text 3/Installed Packages
found 4 files for base name Default.sublime-keymap
found 1 files for base name Default.sublime-mousemap
found 3 files for base name Main.sublime-menu
loading bindings
loading pointer bindings
found 1 files for base name Default.sublime-theme
theme loaded
app ready
startup cache, total files: 154 cache hits: 154
pre session restore time: 0.190566
using gamma: 2 (err: 6.9282)
first paint time: 0.290032
startup time: 0.311181
launching: /Applications/Sublime Text.app/Contents/MacOS/plugin_host
reloading plugin Default.block
reloading plugin Default.comment
reloading plugin Default.copy_path
reloading plugin Default.delete_word
reloading plugin Default.detect_indentation
reloading plugin Default.duplicate_line
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.indentation
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_file_settings
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.swap_line
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.trim_trailing_white_space
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin IJulia.__init__
reloading plugin IJulia.IJulia
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 73, in reload_plugin
    m = importlib.import_module(modulename)
  File "X/importlib/__init__.py", line 88, in import_module
  File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 671, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "IJulia in /Users/mullspace/Library/Application Support/Sublime Text 3/Installed Packages/IJulia.sublime-package", line 2, in <module>
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 671, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "KernelManager in /Users/mullspace/Library/Application Support/Sublime Text 3/Installed Packages/IJulia.sublime-package", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 671, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "ZMQ in /Users/mullspace/Library/Application Support/Sublime Text 3/Installed Packages/IJulia.sublime-package", line 9, in <module>
  File "X/ctypes/__init__.py", line 431, in LoadLibrary
  File "X/ctypes/__init__.py", line 353, in __init__
OSError: dlopen(/usr/local/Cellar/zeromq/3.2.4/lib/libzmq.dylib, 6): image not found
reloading plugin IJulia.JuliaSyntax
reloading plugin IJulia.KernelManager
reloading plugin IJulia.ZMQ
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 71, in reload_plugin
    m = imp.reload(m)
  File "X/imp.py", line 252, in reload
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 671, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "ZMQ in /Users/mullspace/Library/Application Support/Sublime Text 3/Installed Packages/IJulia.sublime-package", line 9, in <module>
  File "X/ctypes/__init__.py", line 431, in LoadLibrary
  File "X/ctypes/__init__.py", line 353, in __init__
OSError: dlopen(/usr/local/Cellar/zeromq/3.2.4/lib/libzmq.dylib, 6): image not found
reloading plugin Package Control.Package Control
loaded 845 snippets
plugins loaded
hey
Package Control: Skipping automatic upgrade, last run at 2013-11-27 10:52:10, next run at 2013-11-27 11:52:10 or after
quinnj commented 11 years ago

Yeah, so it's not finding the ZMQ library. Probably the easiest option is to manually locate your library and then make a symlink or copy the library over to the path that Sublime is looking for (i.e. /usr/local/Cellar/zeromq/3.2.4/lib/libzmq). Yeah, sorry for the hassle with this, but unfortunately osx is the odd duck here in terms of ZMQ library installation location. I've talked with some of the ZMQ.jl devs about a fix, but it involves running an install script, so eventually this won't be necessary, but for now, we'll have to do some manual jiggering.

schuberm commented 11 years ago

ln -s ~/.julia/Homebrew/deps/usr/Cellar/zeromq/3.2.3/lib corrects the problem. I can now run IJulia in sublime. Great work.

quinnj commented 11 years ago

That's great. Sorry for the hassle again, but it helps in getting the wrinkles ironed out. I think the solution going forward will be to have a setting the user can set to specify the ZMQ library path (with none specified defaulting to system defaults which should work fine for windows/linux and sometimes on osx). There will also be the option to run an "IJulia Setup" command which will actually spin up Julia to get the path and then set it for you.