-
Notifications
You must be signed in to change notification settings - Fork 49
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
Trouble with the magick rock #18
Comments
I have this working on PopOS. So must be a missing dependency on the Mac side. |
I think it's ok, the files should only be in ~/.luarocks/share/lua/5.1/magick. |
This works when I just run it with package.path = package.path .. ";" .. "/Users/benlubas/.luarocks/share/lua/5.1/?/init.lua"
package.path = package.path .. ";" .. "/Users/benlubas/.luarocks/share/lua/5.1/?.lua"
local ok, err = pcall(require, "magick")
if ok then
print("that worked")
else
print("that failed")
end |
after looking at this more, the real error is Which is still only happening in NeoVim. I don't get that when I run the thing with luajit |
Problem is definitely something do with homebrew installing it somewhere unexpected. |
Edit: using this solution might break when homebrew updates/moves things around. For a more permanent fix, see solutions at the bottom of the thread So the exact command that someone else might run to fix it might vary. But this is the one that I used:
You just need to link the libMagick dylib file that your neovim is looking for to a spot nvim can find it. I hope that helps someone in the future. |
Hi @benlubas, since you mentioned having this working on pop-os, which I'm also running, may I ask if there where any major steps to make it work? PS: I'm excited about what you are doing with molten-nvim! Looks like it will complement quarto-nvim immensly! Asking if you can show code results and plots directly under the cells is probably the question I get the most. |
It sounds like you have the dependencies all setup, so I wouldn't worry about that. what does your config look like, and what file are you opening to try to see an image? PS: You can send those people to Molten starting in a day or two. I just finished up a PR that makes the last set of breaking changes that I wanted to make, going to merge it after a day or two of driving it to make sure I didn't break the whole thing :P |
I tried it as part of my quarto-nvim-kickstarter config and with the minimal setup: https://github.com/3rd/image.nvim?tab=readme-ov-file#try-it-out-with-a-minimal-setup |
Did you add the quarto file type to the file type list for the markdown integration if you're opening a quarto document. Because that's not a supported file type out of the box with the minimal config. |
Should we enable it by default? |
Eh, I'm more in favor of just letting people know they can enable it so it's clear that they can add any filetype that uses the markdown parser, not just the ones that we list. But I that's not a strong opinion |
I did, but the minimal example is plain markdown anyways. |
I guess one other quick thing to check, sometimes I have to make an edit to the file to get an image to show up in markdown. Like pressing |
sorry to hijack this thread, btw. starting
The same png displays fine with |
what kitty version are you on? |
0.21.2 |
Update, latest is 30.x lol |
That works indeed! I had assumed that you were also on the latest version from the pop-os apt repo, which is 0.21. |
Thanks! :) Exciting times for terminal data science! |
Great! Glad that worked. I put up a PR to add this requirement to the readme as I wasn't aware of it either |
Uh, it also works in Wezterm out of that box, since that supports the kitty graphics protocoll! |
I'll refer you to this comment. As much as I want to use wezterm, I had a much worse experience with it. That said, I haven't tried it in a while, so maybe it works better now? |
adding |
I had imagemagick installed in a non default location (
I found this error because I see a lua error when opening vim in a corner, bad formatted, saying that couldn't find |
For anyone using eval "$(luarocks path --bin)" # you can also add LUA_PATH based on your own setup
set -gx DYLD_LIBRARY_PATH /opt/homebrew/lib # you should see libMagickxxxx lib files in this folder |
I tried literally everything above, but it still doesn't work. |
@neuromaancer what's your Neovim version? |
Mine is the stable version of |
version should be ok, other people seem to have it working on mac #91 (comment) |
Yeah, actually, it didn't load the |
I've installed pkg-config via homebrew and now it works. |
this works for me. |
set DYLD_LIBRARY_PATH to "(brew --prefix)/lib" that solved the issue for me |
Has anyone managed to get image.nvim to run with linuxbrew via wsl2? Tried the export DYLD_LIBRARY_PATH without success. Have magick installed via luarocks and homebrew (imagemagick), via luarocks I went ahead and installed the same version into the local and system scope (tried to cover all the bases in case I missed something). Plugin still shows ascii/gibberish when neo-tree previews a png, or molten/quarto try to run a visual. nvim nightly, kitty 0.32.0, ubuntu 20.04.3 LTS Jammy. |
@eo1989 does this help? #93 (reply in thread) |
No unfortunately it makes no difference. |
Actually, I have tried everything above, and still not able to get the image. But after trying everything, Neovim is able to load the magick. |
This linking trick worked like a charm. Beforehand needed to install rock using 5.1 argument for lua version. I was doing this on WSL kali linux distribution. |
I encountered the "magick rock not found" error on Ubuntu 24.04 (noble). I had previously gotten this plugin working on Ubuntu 22.04 (jammy), by explicitly setting |
Hello, added a new |
I'm on MacOS on apple silicon (unsure if that's relevant)
I've installed the magick rock with
luarocks --local --lua-version 5.1 install magick
I added
to my
nvim/init.lua
file, and I've checked that the magick folder exists at~/.luarocks/share/lua/5.1/magick
However, I don't have anything other than the
magick/
folder in the~/.luarocks/share/lua/5.1/
directory. This concerns me b/c it seems from thepackage.path
code above that there should be a lua file there (but I have no idea).I have ImageMagic via brew, the
which magick
=>/opt/homebrew/bin/magick
Despite all of this, I still get this error when I launch nvim:
I've also tried with both nvim 9.2, and the latest nightly. same error.
I've also tried the
minimial-setup.lua
file in this repo.The text was updated successfully, but these errors were encountered: