Closed desilinguist closed 10 months ago
Hi and thank you for reporting this!
I just pushed the latest changes to how anaconda works and it looks like you are using the correct options, but it should absolutely not be slow.
You even have the search
setting set to false so it should be instant. Can you add the enable_debug_output
option to the setup function, like:
require("venv-selector").setup({
anaconda_base_path = "/Users/nmadnani/anaconda",
anaconda_envs_path = "/Users/nmadnani/anaconda/envs",
enable_debug_output = true
})
And then VenvSelect
should give you lots of debug output saved in :messages
inside neovim. Type :messages
and share the output and we will probably both be wiser whats going on. :)
Thank you for the quick response! Below is what :messages
shows me after I enable debug output.
One thing I immediately see is that search
is still set to true
for some reason! This is strange because here's the block in lazy.nvim
:
-- allow selecting conda environments from within neovim
{
"linux-cultist/venv-selector.nvim",
config = function()
require("venv-selector").setup({
anaconda_base_path = "/Users/nmadnani/anaconda",
anaconda_envs_path = "/Users/nmadnani/anaconda/envs",
enable_debug_output = true,
})
end,
opts = {
search = false,
search_workspace = false,
search_venv_managers = false,
},
},
Yup that must be the bug, and it explains why its so slow - its searching your entire home directory.
I also see thats its searching the folders under $HOME/anaconda
when it should really be searching only $HOME/anaconda/envs
.
I will have a look tonight or tomorrow why its ignoring the search = false
option all of a sudden. That was really surprising... and then fix the other bug with conda search path also. Thank you!
Ah one thing, I see that you have put both config and opts in two places.
Try this config in lazy.nvim. It will call VenvSelect
setup()
function automatically with your specified options:
{
"linux-cultist/venv-selector.nvim",
dependencies = { "neovim/nvim-lspconfig", "nvim-telescope/telescope.nvim" },
opts = {
enable_debug_output = true,
search = false,
anaconda_base_path = "/Users/nmadnani/anaconda",
anaconda_envs_path = "/Users/nmadnani/anaconda/envs",
},
},
May not fix the bug but makes for cleaner code.
That did it! Thank you so much!! 🙏🏽
Very good! But you still should have that bug with VenvSelect
searching more than $HOME/anaconda/envs
- will fix that later. But at least its fast again for you. :)
Reopening to fix issue with Conda paths asap.
Here's what it shows now:
VenvSelect: Setting fd_binary_name to 'fd' since it was found on system.
/Users/nmadnani/work/rsmtool
"rsmtool/analyzer.py" 2094L, 81842B
VenvSelect: Telescope path: /Users/nmadnani/work/rsmtool
VenvSelect: Found workspace folder: /Users/nmadnani/work/rsmtool
VenvSelect: Running search for workspace venvs with: fd -HItd --absolute-path --color never '^venv$' /Users/nmadnani/work/rsmtool
VenvSelect: Running search for venv manager venvs with: fd . -HItd -tl --absolute-path --max-depth 1 --color never /Users/nmadnani/anaconda/envs
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/acgevaldev/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/adventdev/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/analysis/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/asrapi_dev/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/confbook/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/coursera/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/factanal/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/gcbook/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/hanukkahdev/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/jupyter/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/langchain/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/linters/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/llama/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/opsmodelsdev/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/pydubtest/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/rfs_doc/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/rfsapi_dev/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/rsmdev/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/rsmextradev/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/shap41/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/shap42/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/shellgpt/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/sklldev/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/sklltest/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/speakerbox/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/timedev/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/ttok/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/vimgolf/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/vocabdev/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/vocabprod/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/wwwdocsdev/
VenvSelect: Found venv in VenvManager search: /Users/nmadnani/anaconda/envs/youtube/
Adding: /Users/nmadnani/anaconda/
VenvSelect: There are 33 results to show:
Hmm that actually looks correct!
I guess it was the previous config that confused it maybe. It seems to only lists your envs, and also the base anaconda env, which is correct behavior, so you can switch to that one also if you want. :)
But then I guess we can close this actually... right?
Yes, I think we are good now. Thanks again!
Thanks for the amazing plugin! As a conda user, I was extremely excited to find this and set it up a couple of weeks ago and it worked great. I had set it up to only find my anaconda environments since I don't use any other virtual environment managers. It was really fast!
However, with the latest update, I am now finding that it takes a few seconds to update in every project directory. I have tried the various config options but nothing seems to fix it. I am 90% sure that this is a problem with me not finding the correct set of config options and so I am writing to ask for help here.
I install the plugin with
lazy.nvim
like so:and set it up like so:
Here's a video showing how long the telescope view takes to populate and that it's still looking in places where it shouldn't be. Any suggestions will be greatly appreciated.
https://github.com/linux-cultist/venv-selector.nvim/assets/161680/bfba7de5-49dd-49e2-81fe-2491180f5056