Closed bpnordin closed 6 months ago
I'm on a train currently, so no Internet and answering from my phone, but I have a few ideas:
You probably need to update to the master branch of image.nvim and I probably need to update my docs. If that doesn't fix it could you try these things:
Can you try putting a line below the last one that you send to molten? I don't think that would be an issue but it could be.
Can you see the output if you enter the floating window? You can open that with :noautocmd MoltenEnterOutput
what happens if you scroll the window (with <c-e>
/<c-y>
) both from in the float and from outside the float.
Updated on master branch, and no luck :
<C-e>
until it looks like this
basically I can only scroll one line to where Out[1]: Done is no longer visible.
When outside the floating window, the floating window will move up the screen like it is pinned to the spot just underneath the code. Until I scroll too far, the cursor is pushed down, and it disappears. Nothing crazy, all seems normal.
Yup all that behavior seems normal. I've got time to dig into this. Thank you for providing a minimal config, i'll take a look.
@bpnordin I can see the image when the output opens the first time, but then if I close the window, the image doesn't show up again. This seems to be related to #84. I'll fix that or revert it if it's too complex (that change didn't make much of a perf impact iirc).
I think I did find the one difference between that image.nvim test and when I try to use molten. It is which python
is running. When I just use the system python(nothing installed), I can render. When I can't render, I am using a virtual python envirnment, but everything is installed. I will play around with it some more.
Using this to test rendering:
:lua require("image").from_file("image.png"):render()
I am now getting a different output when just using the system python. I also have another picture rendered to show that image.nvim is working Am I just running the wrong code?
I am now getting a different output when just using the system python
Interesting. I wonder if there is a larger issue here then. Do you normally have python3_host_prog
set? I didn't see it in the minimal config and I had to add it to mine as I have all my molten dependencies installed in a virtual environment.
Also I just merged the revert, if you could try using the main branch of molten now that will definitely fix a problem. But perhaps not the exact problem that you're having.
I normally start NeoVim with a virtualenv active and then I have all of the dependencies for molten installed in that virtualenv, if I am going to use it.
I set the python3_host_prog
to the virtualenv instead of activating it
It seems that if I have a virtual environment activated, then rendering in general doesn't work. If I set the host-prog, then it does work. Hmmm
However, even after I updated molten, it still doesn't render the plot.
This is the same behavior if I just use the system python (non-virtualized)
It seems that if I have a virtual environment activated, then rendering in general doesn't work. If I set the host-prog, then it does work. Hmmm
that's odd. I will say that you should be using host-program and a corresponding neovim virtual environment. They way neovim will always launch with the necessary decencies, and you don't have to install all the modules molten needs in every venv you create.
Exactly the same issue here. Also on mac m1. But i dont run a special venv.
Unfortunately I can't help much without a reproduction, I'm not seeing the issue with the current repro.
I do wonder if pyenv
has anything to do with it b/c I personally don't use it.
@sphyrnidae8 are you using pyenv as well?
Both of you should 100% set vim.g.python3_host_prog
so you know for sure what environment neovim is working with. Otherwise it seems to choose venv or system, and it's not exactly the most reproducible thing.
I recommend setting up a neovim
venv the way the docs suggest. This way you can install the packages for neovim once, in once place, and they're not interfered with by anything else.
I think it does have something to do with pyenv. I was using pyenv for the different versions of python. I just uninstalled it and used a homebrew install of python3.10 and set up the environment like in your docs. Now everything works. Thanks!
Also I just merged the revert, if you could try using the main branch of molten now that will definitely fix a problem. But perhaps not the exact problem that you're having.
and yes updating to master has fixed an issue where it will only display the plot the first time in the output, and not if the output hides and then displays again
Awesome! I'm curious about pyenv, now that I know that it's a problem I can look into it. I'm going to open a separate issue to track that problem. nah I'll just change the name of this issue so there's all this context on it.
Thank you for working with me on this one, environment issues are always tricky.
I probably won't get around to this until after Christmas though
I can't reproduce this issue with pyenv. I've installed it, set it up, activated it, installed pynvim and jupyter_client (and ipykernel), tested it with both an existing kernel and the new default python3 kernel, they both work. Images show in virtual text and in floating windows, and they show in multiple floating windows as well.
I did confirm with :checkhealth
that the expected pyenv version of python was being used. also I used python 3.11
My only guess is that you missed something with your pyenv install that you didn't miss when following the docs.
I can't reproduce this issue with pyenv. I've installed it, set it up, activated it, installed pynvim and jupyter_client (and ipykernel), tested it with both an existing kernel and the new default python3 kernel, they both work. Images show in virtual text and in floating windows, and they show in multiple floating windows as well.
I did confirm with
:checkhealth
that the expected pyenv version of python was being used. also I used python 3.11My only guess is that you missed something with your pyenv install that you didn't miss when following the docs.
I met a similar issue and I am pretty sure this is not caused by pyenv but poetry, which is commonly used together with pyenv. This is a known issue with image.nvim and there is no fix, but the workaround is to source the venv created by poetry directly instead of using the poetry shell
Description
There is no image in the output, even though everything else is correctly displaying.
I believe I have everything properly installed
and image.nvim works just fine with the test that they provide:
The issue is a lot like #7 on image.nvim repo. However, the fix/troubleshooting steps on that issue did not pertain to my issue with molten-nvim.
I am using a minimal test config file for neovim so that variables can be isolated (I didn't use a color scheme in the screenshots because I thought that might be the issue, but I added it back because it looks better)
Reproduction Steps
I am running python 3.12.1 currently. But I have also tried this with 3.11. Here are the python packages I have installed
For these current screenshots open up NeoVim with the slim config file
run the python file to test the plotting behavior
Expected Behavior
I expect that the plot would be drawn in the output box. I have tried changing settings in Molten but nothing I have tried has fixed the issue. If I am doing anything wrong let me know. I guess it seems like the issue would be Molten if image.nvim is able to output images with the exact same config.