Code Monkey home page Code Monkey logo

Comments (18)

bpnordin avatar bpnordin commented on July 17, 2024 1

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!

from molten-nvim.

benlubas avatar benlubas commented on July 17, 2024

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.

from molten-nvim.

bpnordin avatar bpnordin commented on July 17, 2024

Updated on master branch, and no luck :
image

  1. extra lines on the bottom don't help
  2. If I enter the floating window I still can not see the image
  3. When inside the floating window, I can scroll <C-e> until it looks like this
image

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.

from molten-nvim.

benlubas avatar benlubas commented on July 17, 2024

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.

from molten-nvim.

benlubas avatar benlubas commented on July 17, 2024

@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).

from molten-nvim.

bpnordin avatar bpnordin commented on July 17, 2024

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()

from molten-nvim.

bpnordin avatar bpnordin commented on July 17, 2024

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?
image

from molten-nvim.

benlubas avatar benlubas commented on July 17, 2024

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.

from molten-nvim.

bpnordin avatar bpnordin commented on July 17, 2024

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
image

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.
image

This is the same behavior if I just use the system python (non-virtualized)

from molten-nvim.

benlubas avatar benlubas commented on July 17, 2024

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.

from molten-nvim.

sphyrnidae8 avatar sphyrnidae8 commented on July 17, 2024

Exactly the same issue here. Also on mac m1. But i dont run a special venv.

from molten-nvim.

benlubas avatar benlubas commented on July 17, 2024

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?

from molten-nvim.

benlubas avatar benlubas commented on July 17, 2024

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.

from molten-nvim.

bpnordin avatar bpnordin commented on July 17, 2024

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

from molten-nvim.

benlubas avatar benlubas commented on July 17, 2024

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.

from molten-nvim.

benlubas avatar benlubas commented on July 17, 2024

I probably won't get around to this until after Christmas though

from molten-nvim.

benlubas avatar benlubas commented on July 17, 2024

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.

from molten-nvim.

Zexius avatar Zexius commented on July 17, 2024

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 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

from molten-nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.