[Python] Running vscode debugger on python file does not seem to be producing any results

Discussão em 'Python' iniciado por Stack, Setembro 26, 2024.

  1. Stack

    Stack Membro Participativo

    I'm using vscode windows to debug a python project If I right click the file and press run file in terminal it runs fine with this command:

    C:/Users/rmarr/Documents/python-envs/.mlagents/Scripts/python.exe c:/Users/rmarr/Documents/python-envs/.mlagents/Lib/site-packages/mlagents/learn-copy.py


    However running it in the python debugger does not produce any results config.json:

    {
    "version": "0.2.0",
    "configurations": [
    {
    "name": "Python: Current File",
    "type": "debugpy", // You can use "debugpy" as well
    "request": "launch",
    "program": "${workspaceFolder}/learn-copy.py",
    "console": "integratedTerminal",
    "justMyCode": false // Set this to false to debug all code
    }
    ]
    }


    When I click run I get on the cli:

    cmd /C "c:\Users\rmarr\Documents\python-envs\.mlagents\Scripts\python.exe c:\Users\rmarr\.vscode\extensions\ms-python.debugpy-2024.10.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher 57348 -- C:\Users\rmarr\Documents\python-envs\.mlagents\Lib\site-packages\mlagents/learn-copy.py


    I made sure that both the regular and debugger terminal are signed into the virtual environment. Also I'm working with the unity mlagents code which is not my own but I specified "justMyCode": false in the config.json which I expect to take care of this. I also set breakpoints in the code

    Update: if I use my environment with Python 3.12.6 it works fine however I need to use my environment with 3.7.0. Not sure how this changes the outcome

    Continue reading...

Compartilhe esta Página