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

How do I set up a virtual environment that dape can use for python3? #102

Open
Odysseus6000 opened this issue Apr 12, 2024 · 1 comment
Open

Comments

@Odysseus6000
Copy link

My dape is configured as follows:
`(use-package dape
:ensure t
:config
(setq dape-debug t)
(add-to-list 'dape-configs
'(debugpy
modes (python-ts-mode python-mode)

             command "python3"
             command-args ("-Xfrozen_modules=off" "-m" "debugpy.adapter")
             :type "python"
            ;;  :request "attach"
             :request "launch"
             :module ""
            ;;  :cwd dape-cwd-fn
              ))

)The following error occurs when running debug in dape-repl:debug

  • Adapter started with "python3 -Xfrozen_modules=off -m debugpy.adapter" *
    Process launched
    ~/.virtualenvs/pro/bin/python3: No module named
  • Exit code: 1 *
  • Session terminated *
    `
    mac,[email protected], dape-0.10.0.0.20240404.182237
@svaante
Copy link
Owner

svaante commented Apr 16, 2024

I think the issue is that you are specifying :module as "" debugpy options. If you want to debug an module you need to specify the module name. If you want to debug an file use :program.

If you don't want to roll you own configurations you could change the ones which are included as:

(dolist (config-name '(debugpy debugpy-module))
  (let ((debugpy-config (alist-get config-name dape-configs)))
    (plist-put debugpy-config 'command
               "python3")
    (plist-put debugpy-config 'command-args
               '("-Xfrozen_modules=off" "-m" "debugpy.adapter" "--host" "0.0.0.0" "--port" :autoport))))

Not that pretty.

Why do you need to specify -Xfrozen_modules=off?

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