Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swenv plugin to switch between vritual environmnts. #51

Open
skimask9 opened this issue Nov 16, 2022 · 1 comment
Open

Swenv plugin to switch between vritual environmnts. #51

skimask9 opened this issue Nov 16, 2022 · 1 comment

Comments

@skimask9
Copy link

{ "AckslD/swenv.nvim",
   config = function()
     require('swenv').setup({
       -- Should return a list of tables with a `name` and a `path` entry each.
       -- Gets the argument `venvs_path` set below.
       -- By default just lists the entries in `venvs_path`.
       get_venvs = function(venvs_path)
         return require('swenv.api').get_venvs(venvs_path)
       end,
       -- Path passed to `get_venvs`.
       venvs_path = vim.fn.expand('~/venvs'),
       -- Something to do after setting an environment
       post_set_venv = nil,
     })
   end
 },

lvim.builtin.which_key.mappings["P"] = {
 name = "Python",
 i = { "<cmd>lua require('swenv.api').pick_venv()<cr>", "Pick Env" },
 d = { "<cmd>lua require('swenv.api').get_current_venv()<cr>", "Show Env" },
}

get_current_venv doesn't work at all
pick_venv failed with the error "venvs is not accessible by the current user!"

@mblarsen
Copy link

mblarsen commented Jun 13, 2024

Did you ever figure out where the "is not accessible by the current user" error comes from?

I'm seeing the same when using the scan_dir from the plenary.nvim library:

"/path/to/journal is not accessible by the current user!"

-- scandir.lua
  for i = #base_paths, 1, -1 do
    if uv.fs_access(base_paths[i], "X") == false then
      if not F.if_nil(opts.silent, false, opts.silent) then
        print(string.format("%s is not accessible by the current user!", base_paths[i]))
      end
      table.remove(base_paths, i)
    end
  end

Not sure why it happens

SOLVED: in my case it was a wrong path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants