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

Error with ptvsd #5

Open
Gaetanbrl opened this issue Oct 8, 2020 · 1 comment
Open

Error with ptvsd #5

Gaetanbrl opened this issue Oct 8, 2020 · 1 comment

Comments

@Gaetanbrl
Copy link

Gaetanbrl commented Oct 8, 2020

Hi, I have followed the advices :

https://gist.github.com/AsgerPetersen/9ea79ae4139f4977c31dd6ede2297f90

  • Install ptvsd from Qgis 3.10 python env :
    C:\PROGRA~1\QGIS 3.10\apps\Python37>pip install ptvsd==4.1.4

  • Install debugvs plugin

  • Identify plugin folder :
    C:\Users\my_user\Documents\git\QgisCadastrePlugin\cadastre

  • Open this plugin folder with VS Code (right click + open with code)

  • Select python 3.7 from Qgis
    image

  • Create new debug launch.json file like that :

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Attacher",
            "type": "python",
            "request": "attach",
            "connect": {
                "host": "localhost",
                "port": 5678
            },
            "pathMappings": [
                {
                    "localRoot": "${workspaceFolder}",
                    "remoteRoot": "${workspaceFolder}"
                }
            ]
        }
    ]
}

  • I open QGIS and activate Cadastre plugin. Click the debugvs button ang i get this error :

image

  • When i modify debugvs plugin and remove t_ it works :

t_, self.port = self.ptvsd.enable_attach( address = ( self.host, self.port ) )

I could check output text info in VScode but no way to stop process on breakpoint.

Thanks.

@Gaetanbrl Gaetanbrl changed the title Error with pytvsd Error with ptvsd Oct 8, 2020
@lmotta
Copy link
Owner

lmotta commented Oct 8, 2020

The docstring about 'ptvsd.enable_attach' show that function return a tuple.

Please try use in your .vscode/launch.json:
{
"configurations": [
{
"name": "Python: QGIS Debugger",
"type": "python",
"request": "attach",
"host": "localhost",
"port": 5678
},
]
}

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