AckslD / swenv.nvim

Tiny plugin to quickly switch python virtual environments from within neovim without restarting.
206 stars 29 forks source link

Using Pyenv instead of Conda #38

Closed Nicola-Bini closed 5 months ago

Nicola-Bini commented 5 months ago

Hi @AckslD,

Does this plugin requires conda? or is it also able to read local virtual environment created with (python -m venv .venv)? I tried running it but it's returning the following error. My understanding is that the plugin reads the CONDA_EXE env variable to find environments. Is there a way to use pyenv instead?

E5108: Error executing lua ...lunarvim/site/pack/lazy/opt/swenv.nvim/lua/swenv/api.lua:12: attempt to index local 'conda_exe_path' (a userdata value) stack traceback: ...lunarvim/site/pack/lazy/opt/swenv.nvim/lua/swenv/api.lua:12: in function 'get_conda_base' ...lunarvim/site/pack/lazy/opt/swenv.nvim/lua/swenv/api.lua:55: in function 'get_venvs' ...lunarvim/site/pack/lazy/opt/swenv.nvim/lua/swenv/api.lua:81: in function 'pick_venv' [string ":lua"]:1: in main chunk

I loved the plugin!! Thank you so much for this!

AckslD commented 5 months ago

Hi @Nicola-Bini, could you try to update the plugin, looks like this is using an old version

Microwave-WYB commented 5 months ago

If you are coming from the post or the YouTube video, you are probably installing this repo instead. You can simply replace "ChristianChiarulli/swenv.nvim" with "AckslD/swenv.nvim"

Nicola-Bini commented 5 months ago

Thank you both! you were right, I first installed the fork from Lunarvim, then replaced it with this repo. For some reason packer in Lunarvim is not set to update plugins on startup.