question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

remote debug hangs when remote is python3

See original GitHub issue

From @bradanlane on March 8, 2017 23:28

Environment data

VS Code version: 1.10.2 Python Extension version: tested 0.5.9 and 0.6.0 Python Version: local: windows 3.5.3 remote: raspbian 3.4.2 OS and version: local windows 10, remote raspbian jessie (debian 8)

Actual behavior

start remote program (python3 tutorial01.py) and then start local debugger and then it just waits

Expected behavior

if I start the remote program with python 2.7.9 (python tutorial01.py) remote debugging works and my local display stops at the first breakpoint

Steps to reproduce:

  • (installed ptvsd for both python and python3)
  • start program on remote using python3 tutorial01.py
  • remote program waits
  • start debugger on local and the control bar appears and then it just waits
  • stop remote program and local debugger
  • start program on the remote using python tutorial01.py
  • start debugger on local and control bar appears with all options enabled
  • first breakpoint is highlighted

Settings

Your launch.json (if dealing with debugger issues):

{
            "name": "Attach (Remote Debug)",
            "type": "python",
            "request": "attach",
            "localRoot": "${workspaceRoot}",
            "remoteRoot": "/home/pi",
            "port": 3000,
            "secret": "nosecret",
            "host": "192.168.6.47"
}

Your settings.json:
(I tried with and without the following line)

"python.pythonPath": "c:/tools/python3/python3.exe"

Logs

Output from Python output panel

no output generated  when trying to use python3 on remote

Output from Console window (Help->Developer Tools menu)

no output generated when trying to use python3 on remote

##Test program

import ptvsd
#ptvsd.enable_attach("nosecret")
ptvsd.enable_attach("nosecret", address=('0.0.0.0', 3000))
ptvsd.wait_for_attach()
#ptvsd.break_into_debugger()

print ('starting ...')
person = input('Enter your name: ')
print('Hello', person)
print(' ... finished')

Copied from original issue: DonJayamanne/pythonVSCode#805

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:22 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
brettcannoncommented, May 7, 2018

Closing due to lack of response for more info. If the info is provided in the future we will be happy to re-open this.

0reactions
DonJayamannecommented, Mar 8, 2018

@bradanlane Apologies for not getting back to you on this. Have you managed to get this working? Please check the following documentation https://code.visualstudio.com/docs/python/debugging#_remote-debugging

Read more comments on GitHub >

github_iconTop Results From Across the Web

remote debug hangs when remote is python3 #92 - GitHub
I have a similar issue with python 2.7.10 where the remote debugger hangs running some of my project. While trying to debug this...
Read more >
Hanging issues with Remote Debugging : PY-9699
Start up the debugger in PyCharm 2. Use the tool I've been developing to initiate the pydevd.settrace() call in the Python script running...
Read more >
Visual Studio Code gets stuck during attaching remote ...
The issue mentioned most often is that VSC 'just hangs' when trying to connect to your remote debugger. For now, use ptvsd 3.0.0:...
Read more >
Remote Debugging - Python Scripting - Vectorworks Forum
I am trying remotely debug a plugin with Eclipse and Pydevd on MAC OSX ... but after that it will just constanting freeze...
Read more >
Python Remote Debugging in PyCharm: A Tutorial - Rookout
Prerequisites. Python project; PyCharm community edition; Python 3+. You're going to want to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found