Giter VIP home page Giter VIP logo

Comments (6)

linux-cultist avatar linux-cultist commented on July 28, 2024

Hmm, can you show me what you have in your plugin config? Will try to see what it can be. :)

And yes, wildcards would be nice in venv names. I think I could support regexp expressions here but need to look into it a bit.

from venv-selector.nvim.

mgua avatar mgua commented on July 28, 2024

A possible idea could be to "detect" virtual environment folders basing on the folder structure and contents. This could allow to present a very accurate choice list for target environments

from venv-selector.nvim.

mgua avatar mgua commented on July 28, 2024

I would like to be able to use wildcards in specifying the env list in name={"venv","venv_*"}

if anyway I hardcode my venvname there, I get an error apparently related to missing write privileges on a folder which appears writable.

E5108: Error executing lua Vim:E482: Can't open file %APPDATA%\venv-selector\venvs.json for writing: no such file or directory
stack traceback:
        [C]: in function 'writefile'
        ...-data/lazy/venv-selector.nvim/lua/venv-selector/venv.lua:303: in function 'cache_venv'
        ...-data/lazy/venv-selector.nvim/lua/venv-selector/venv.lua:207: in function 'activate_venv'
        .../lazy/venv-selector.nvim/lua/venv-selector/telescope.lua:76: in function 'key_func'
        ...nvim-data/lazy/telescope.nvim/lua/telescope/mappings.lua:352: in function 'execute_keymap'
        [string ":lua"]:1: in main chunk
Press ENTER or type command to continue```

Any hints?

I reproduced this issue, while selecting the venv_mfa project of ours (I work with Klaudija aka wonderturtle) on a windows desktop.
image
plugin config is straightforward from your sample

return {
	"linux-cultist/venv-selector.nvim",
	dependencies = { "neovim/nvim-lspconfig", "nvim-telescope/telescope.nvim" },
	keys = {{
		"<leader>vs", "<cmd>:VenvSelect<cr>",
		"<leader>vc", "<cmd>:VenvSelectCached<cr>"
	}},
	config = function()
		require("venv-selector").setup({
		auto_refresh = false,
		search_venv_managers = true,
		search_workspace = true,
		search = true,
		dap_enabled = false,
		parents = 2,
		name = {"venv","venv_mfa","venv_nvim"}, -- NOTE: You can also use a lua table here for multiple names: {"venv", ".venv"}`
		fd_binary_name = "fd",
		notify_user_on_activate = true,
		})
	end;
	event = "VeryLazy", 
}

from venv-selector.nvim.

mgua avatar mgua commented on July 28, 2024

i thought this had to do with the fact that we launch neovim from its own python environment, but this is not the case. Error comes also if nvim is lauched without its venv being activated.

from venv-selector.nvim.

linux-cultist avatar linux-cultist commented on July 28, 2024

The error should be fixed now thanks to #32 but that wasnt related to the virtual environment names.

So lets keep this issue open so someone (maybe me) can add regular expression possibility here for the venv names.

from venv-selector.nvim.

linux-cultist avatar linux-cultist commented on July 28, 2024

This idea with regular expressions has come up more than once now, and I think it would be a good idea. I will close this issue and open another issue for the regular expression idea.

Lua is not great at regular expressions though but maybe there is a way.

from venv-selector.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.