linux-cultist / venv-selector.nvim

Allows selection of python virtual environment from within neovim
MIT License
378 stars 40 forks source link

Plugin can find venv's but activating them results in file `python` with gibberish content #144

Closed guyonmatteau closed 2 weeks ago

guyonmatteau commented 2 weeks ago

Hi! I am trying to setup the plugin with Lua. Installation seems to work, and it also lists a set of virtual envs (virtualenv, Poetry, etc). However when I hit enter on a selected virtual env a file opens with name python with the gibberish content:

Ïúíþ@… H__PAGEZERO8__TEXT@@__text__TEXT˜?˜?€__stubs__TEXTœ?œ?€__unwind_info__TEXT¨?X¨?˜__DATA_CONST@@@@__got__DATA_CONST@@H__LINKEDIT€@€4€€h3€h€ €X(P

P /usr/lib/dyldâ3›Sù8L¥ÚÙANwƒ2 
÷*(€˜?hÿ–/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation`

/Users/user/.pyenv/versions/3.10.13/lib/libpython3.10.dylibH

/opt/homebrew/opt/gettext/lib/libintl.8.dylib88/usr/lib/libSystem.B.dylib€@/Users/user/.pyenv/versions/3.10.13/lib€ /opt/homebrew/lib&ˆ€)€€‚˜°@ùÖ˜?@@œ?@€ PX@@_Py_BytesMain__mh_execute_header˜$˜?d*d–dŸf(èKe.˜?$˜?$N˜?d __mh_execute_header_Py_BytesMain_main/var/folders/29/gb84vhfs0mqfc98tbtjnvvpw0000gn/T/python-build.20231108205650.25335/Python-3.10.13/Programs/python.c/private/var/folders/29/gb84vhfs0mqfc98tbtjnvvpw0000gn/T/python-build.20231108205650.25335/Python-3.10.13/Programs/python.o_mainúÞÀ—úÞƒcX ‚€ python.exe–×"§©CwƯ8êÓM³gÁ\;SŽD¼>ní­¬²XoÆéfÀ×ÑÑkOXÿ|´|z…Ú½‹H‰,§­¬²XoÆéfÀ×ÑÑkOXÿ|´|z…Ú½‹H‰,§?ʲ¨ãtï,2„l³Š#ûtL2xE­zr³jˆÄŸLÁßÕë†ñ•f¡,6ôcfñ
¸Ôî£Ò[‚àå’´í­¬²XoÆéfÀ×ÑÑkOXÿ|´|z…Ú½‹H‰,§­¬²XoÆéfÀ×ÑÑkOXÿ|´|z…Ú½‹H‰,§­¬²XoÆéfÀ×ÑÑkOXÿ|´|z…Ú½‹H‰,§BîK]üµùÕ<¬:“$œ©g¾k|&h­áØô¨’á

Seems to be some sort of encoding issue? I'm on Mac Sonoma 14.1 with a bash shell, Python 3.10 or 3.12, with the plugin selector as described in the README. I verified in lazy-lock.json that the commit is corresponding to the regexp branch, so the plugin should be up-to-date.

return {
  "linux-cultist/venv-selector.nvim",
  dependencies = {
    "neovim/nvim-lspconfig",
    "mfussenegger/nvim-dap",
    "mfussenegger/nvim-dap-python", --optional
    { "nvim-telescope/telescope.nvim", branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim" } },
  },
  lazy = false,
  branch = "regexp", -- This is the regexp branch, use this for the new version
  config = function()
    require("venv-selector").setup()
  end,
  keys = {
    { ",v", "<cmd>VenvSelect<cr>" },
  },
}

Any idea?

linux-cultist commented 2 weeks ago

Wow that sounds really weird. It looks like it's opening your python executable instead of executing it. This looks like some problem with the python installation, but I don't know exactly what it can be. I don't think it's a problem with the plugin, other Mac users are using it without problems too. Maybe you are missing execute permissions on the python interpreter?

linux-cultist commented 2 weeks ago

Did you manage to figure out what is causing your python to be opened rather than executed? I would check if it's executable but it should be by default on installation with brew.

linux-cultist commented 2 weeks ago

Closing this since I dont think its a plugin issue.