linux-cultist / venv-selector.nvim

Allows selection of python virtual environment from within neovim
MIT License
442 stars 46 forks source link

How to active the python environment? #65

Closed cxzhou35 closed 12 months ago

cxzhou35 commented 1 year ago

Hi author, Thank you for this wonderful plugin, which helps me a lot, but I meet some problems here. When I trigger the VenvSelect command with the defined keymap, the envs menu will popup, all this is working properly.

image

But when I choose one of the conda env with the <CR> keymap, it will jump to the envs folder without activing the chosen envs, how to fix that?

I am using lazyvim as my config, here is the config related to this plugin.

return {
  "linux-cultist/venv-selector.nvim",
  cmd = "VenvSelect",
  dependencies = { "neovim/nvim-lspconfig", "nvim-telescope/telescope.nvim" },
  event = "VeryLazy",
  opts = {
    search = false,
    name = {
      "venv",
      ".venv",
      "env",
      "envs",
      ".env",
    },
    anaconda_base_path = "/Users/vercent/miniconda3",
    anaconda_envs_path = "/Users/vercent/miniconda3/envs",
  },
  keys = { { "<leader>cv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv" } },
}
linux-cultist commented 1 year ago

Hi and thank you!

It should activate the venv so not sure what is going on. Can you add "enable_debug_output = true" to your VenvSelect options and restart neovim? Then when you use the plugin, you will get lots of messages and you can see all of them if you type :messages in neovim. Share the output here and we will maybe see what's going on. Thank you!

cxzhou35 commented 1 year ago

Thank you for your quick reply, I have tried what you suggest, here is the message: image

And more, I found that this case happened when I choose the first env without typing anything into the input box, if I type some input texts then choose one of the results, this plugin works as well. I can't read something related to this case according to the message :(

linux-cultist commented 1 year ago

Thank you for the picture, but I dont see anything strange going on from that...

When you pick a venv, you should see a message that its been activated also.

Can you copy paste all the text from VenvSelect here by typing :messages in neovim? You should get lots of lines of text that you can copy into a message here. Maybe there is more lines than your screenshot shows. It should at least show your config at the top also.

And can you install https://asciinema.org/ and make a short video showing the problem? Make sure to not include any personal information in the video just in case.

linux-cultist commented 12 months ago

Closing this because of no response, but please open if you think there is an issue. :)

SerMeliodas commented 7 months ago

Closing this because of no response, but please open if you think there is an issue. :)

I have the same issue.

nv

bartopine commented 7 months ago

Hello! .. i have the same issue also .. when i select a virtual environment from the list .. instead of activating the venv .. it goes to the directory explorer showing the selected venv folder contents.

Found the solution .. when confirming using in normal mode .. it will go to the file explorer .. when confirming in insert mode .. it activates the venv.. @SerMeliodas

SerMeliodas commented 7 months ago

Hello! .. i have the same issue also .. when i select a virtual environment from the list .. instead of activating the venv .. it goes to the directory explorer showing the selected venv folder contents.

Found the solution .. when confirming using in normal mode .. it will go to the file explorer .. when confirming in insert mode .. it activates the venv.. @SerMeliodas

Thanks, i'll try it.