Giter Club home page Giter Club logo

Comments (12)

puremourning avatar puremourning commented on May 18, 2024 1

only somewhat. that issue complains that the key is mandatory. in your case, you just need to set it. install_gadget.py sets it to the python used to run install_gadget.py. originally I had it just set it to python, but that isn't actually a great default either (e.g. doesn't work on windows)

from vimspector.

puremourning avatar puremourning commented on May 18, 2024

can you please include all of the diagnostics from the issue template? I still need them to help you, bug or otherwise, that's why I always ask for them.

from vimspector.

doronbehar avatar doronbehar commented on May 18, 2024

Sure, here it is:

Vimspector config file:
{
  "configurations": {
    "import_history plugin - remove": {
      "adapter": "debugpy",
      "configuration": {
        "name": "import_history plugin - remove",
        "type": "python",
        "request": "launch",
        "stopOnEntry": true,
        "console": "externalTerminal",
        "debugOptions": [],
        "program": "/var/src/beets/beet",
        "args": [
          "import",
        ]
      }
    }
  }
}

Environment

  • Version of Vimspector: (e.g. output of git rev-parse HEAD if cloned or the
    name of the tarball used to install otherwise) - 86afe89

  • Output of vim --version or nvim --version

$ nvim --version
NVIM v0.4.3
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: 
Compiled by nixbld

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/nix/store/x74imf48c7gv20mzm5i9hhzhc3h46g9m-neovim-unwrapped-0.4.3/share/nvim
"

Run :checkhealth for more info

** Neovim's :checkhealth **:

health#info#check
========================================================================
## info.vim
  - OK: Version 6.5 of standalone info installed.

health#vimtex#check
========================================================================
## vimtex
  - OK: Vim version should have full support!
  - WARNING: bibtex is not executable, so bibtex completions are disabled.
  - OK: General viewer should work properly!
  - ERROR: |g:vimtex_compiler_method| (`latexmk`) is not executable!

health#coc#check
========================================================================
  - OK: Environment check passed

  - OK: Javascript bundle found
  - OK: Service started

health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $COLORTERM='rxvt-xpm'

## tmux
  - OK: escape-time: 0ms
  - INFO: $TERM: tmux-256color
  - WARNING: Neither Tc nor RGB capability set. True colors are disabled. |'termguicolors'| won't work properly.
    - ADVICE:
      - Put this in your ~/.tmux.conf and replace XXX by your $TERM outside of tmux:
          set-option -sa terminal-overrides ',XXX:RGB'
      - For older tmux versions use this instead:
          set-option -ga terminal-overrides ',XXX:Tc'

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: /nix/store/f46991xdlxwak406wzclj0l7ynkfbag1-xsel-unstable-2019-08-21/bin/xsel

## Python 2 provider (optional)
  - INFO: Disabled (g:loaded_python_provider=1).  This might be due to some previous error.
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          /run/current-system/sw/bin/python2 does not have the "neovim" module. :help |provider-python|
          /run/current-system/sw/bin/python2.7 does not have the "neovim" module. :help |provider-python|
          python2.6 not found in search path or not executable.
          /nix/store/4kspxz6m4i2gqinl4x2pvk7snhzy4dxn-python3-3.7.6-env/bin/python is Python 3.7 and cannot provide Python 2.
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - INFO: Using: g:python3_host_prog = "/nix/store/icwsv4zqjbppfdxcxhqfsngw3r0n0vzy-neovim-0.4.3/bin/nvim-python3"
  - INFO: Executable: /nix/store/icwsv4zqjbppfdxcxhqfsngw3r0n0vzy-neovim-0.4.3/bin/nvim-python3
  - INFO: Python version: 3.7.6
  - INFO: pynvim version: 0.4.1
  - OK: Latest pynvim is installed.

## Ruby provider (optional)
  - INFO: Disabled. g:loaded_ruby_provider=1

## Node.js provider (optional)
  - INFO: Disabled. g:loaded_node_provider=1
  • Output of which vim or which nvim:
/run/current-system/sw/bin/nvim
  • Output of :py3 pass:
<empty>
  • Output of :py3 import vim:
<empty>
  • OS: NixOS, unstable.

from vimspector.

doronbehar avatar doronbehar commented on May 18, 2024

Oh and almost forgot: Vimspector log (~/.vimspector.log) - https://gist.github.com/88585555d55895bceac6abf6d21dc8e3

from vimspector.

puremourning avatar puremourning commented on May 18, 2024

So this is what vimspector is being told to execute:

2020-02-16 19:28:58,745 - DEBUG - Message received: {'seq': 4, 'type': 'request', 'command': 'runInTerminal', 'arguments': {'kind': 'external', 'title': 'Python Debug Console', 'args': ['/nix/store/4kspxz6m4i2gqinl4x2pvk7snhzy4dxn-python3-3.7.6-env/bin/python3.7', '/home/doron/.config/nvim/pack/functional/start/vimspector/gadgets/linux/debugpy/build/lib/debugpy/launcher', '/var/src/beets/beet', 'import', '/var/lib/transmission/downloads/VJM 45 - Kenny Burrell/'], 'env': {'DEBUGPY_LAUNCHER_PORT': '43973'}}}

You could try running that from the command line to see if you get the same result ?

from vimspector.

doronbehar avatar doronbehar commented on May 18, 2024

I get the following error:

Traceback (most recent call last):
  File "/nix/store/qa26vf122xl13yvxid9ickn9cgva0aby-python3-3.7.6/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/nix/store/qa26vf122xl13yvxid9ickn9cgva0aby-python3-3.7.6/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/doron/.config/nvim/pack/functional/start/vimspector/gadgets/linux/debugpy/build/lib/debugpy/launcher/__main__.py", line 80, in <module>
    main()
  File "/home/doron/.config/nvim/pack/functional/start/vimspector/gadgets/linux/debugpy/build/lib/debugpy/launcher/__main__.py", line 42, in main
    launcher.connect(launcher_port)
  File "/home/doron/.config/nvim/pack/functional/start/vimspector/gadgets/linux/debugpy/build/lib/debugpy/launcher/../../debugpy/launcher/__init__.py", line 27, in connect
    sock.connect(("127.0.0.1", launcher_port))
ConnectionRefusedError: [Errno 111] Connection refused

And without env, I get:

E+00000.020: Error parsing 'DEBUGPY_LAUNCHER_PORT':

             Traceback (most recent call last):
               File "/home/doron/.config/nvim/pack/functional/start/vimspector/gadgets/linux/debugpy/build/lib/debugpy/launcher/__main__.py", line 36, in option
                 return type(os.environ.pop(name, *args))
               File "/nix/store/qa26vf122xl13yvxid9ickn9cgva0aby-python3-3.7.6/lib/python3.7/_collections_abc.py", line 795, in pop
                 value = self[key]
               File "/nix/store/qa26vf122xl13yvxid9ickn9cgva0aby-python3-3.7.6/lib/python3.7/os.py", line 679, in __getitem__
                 raise KeyError(key) from None
             KeyError: 'DEBUGPY_LAUNCHER_PORT'

             Stack where logged:
               File "/nix/store/qa26vf122xl13yvxid9ickn9cgva0aby-python3-3.7.6/lib/python3.7/runpy.py", line 193, in _run_module_as_main
                 "__main__", mod_spec)
               File "/nix/store/qa26vf122xl13yvxid9ickn9cgva0aby-python3-3.7.6/lib/python3.7/runpy.py", line 85, in _run_code
                 exec(code, run_globals)
               File "/home/doron/.config/nvim/pack/functional/start/vimspector/gadgets/linux/debugpy/build/lib/debugpy/launcher/__main__.py", line 80, in <module>
                 main()
               File "/home/doron/.config/nvim/pack/functional/start/vimspector/gadgets/linux/debugpy/build/lib/debugpy/launcher/__main__.py", line 40, in main
                 launcher_port = option("DEBUGPY_LAUNCHER_PORT", int)
               File "/home/doron/.config/nvim/pack/functional/start/vimspector/gadgets/linux/debugpy/build/lib/debugpy/launcher/__main__.py", line 38, in option
                 raise log.exception("Error parsing {0!r}:", name)


Traceback (most recent call last):
  File "/nix/store/qa26vf122xl13yvxid9ickn9cgva0aby-python3-3.7.6/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/nix/store/qa26vf122xl13yvxid9ickn9cgva0aby-python3-3.7.6/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/doron/.config/nvim/pack/functional/start/vimspector/gadgets/linux/debugpy/build/lib/debugpy/launcher/__main__.py", line 80, in <module>
    main()
  File "/home/doron/.config/nvim/pack/functional/start/vimspector/gadgets/linux/debugpy/build/lib/debugpy/launcher/__main__.py", line 40, in main
    launcher_port = option("DEBUGPY_LAUNCHER_PORT", int)
  File "/home/doron/.config/nvim/pack/functional/start/vimspector/gadgets/linux/debugpy/build/lib/debugpy/launcher/__main__.py", line 38, in option
    raise log.exception("Error parsing {0!r}:", name)
  File "/home/doron/.config/nvim/pack/functional/start/vimspector/gadgets/linux/debugpy/build/lib/debugpy/launcher/__main__.py", line 36, in option
    return type(os.environ.pop(name, *args))
  File "/nix/store/qa26vf122xl13yvxid9ickn9cgva0aby-python3-3.7.6/lib/python3.7/_collections_abc.py", line 795, in pop
    value = self[key]
  File "/nix/store/qa26vf122xl13yvxid9ickn9cgva0aby-python3-3.7.6/lib/python3.7/os.py", line 679, in __getitem__
    raise KeyError(key) from None
KeyError: 'DEBUGPY_LAUNCHER_PORT'

It seems the port is randomly selected?

from vimspector.

puremourning avatar puremourning commented on May 18, 2024

the port is passed in the environment by debugpy. so do something like

DEBUGPY_LAUNCHER_PORT=1234

but I guess it is sort of working.

tbh I'm not sure how 'direnv' works, but you might need to convince debugpy to use the python wrapper script by setting the python in the configuration

it's currently using {"python": "/home/doron/.nix-profile/bin/python3",

try setting that to the one in your direnv in .vimspector.json.

from vimspector.

doronbehar avatar doronbehar commented on May 18, 2024

That seems to be working! However, the issue is that the python executable that should be able to run the program I wish to debug is found in an unpredictable location - in /nix/store/...-python3.7-env/bin/. This python - the python I want debugpy to use, is the 1st python that's found in my $PATH, then how come debugpy doesn't use it?

from vimspector.

puremourning avatar puremourning commented on May 18, 2024

can you try set "python": "python" ?

from vimspector.

doronbehar avatar doronbehar commented on May 18, 2024

That worked as well. Thanks!

from vimspector.

puremourning avatar puremourning commented on May 18, 2024

FWIW this is really a question for the debugpy maintainers (Microsoft): https://github.com/microsoft/debugpy

vimspector doesn't appear to be involved in the problem or the solution.

from vimspector.

doronbehar avatar doronbehar commented on May 18, 2024

Do you think it's somewhat related to microsoft/debugpy#29 ?

from vimspector.

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.