1

I'm on a Jetson Nano Linux Ubuntu 18.4, remoting from a windows platform using VS Code to develop python code.

I'm using Visual Studio Code's debugger and expecting the code to stop at several break points. It doesn't. I'm thinking VSC can't find the .py file from the launch.json file? I don't know how to debug launch.json. Any thoughts?

Python code:

#!/usr/bin/python3
import sys
import argparse
print(f'Length : {len(sys.argv)}')
if len(sys.argv) == 2:
    print(f'Argv[1]: {sys.argv[1]}')
if len(sys.argv) == 2:
    name = sys.argv[1]
else:
    name = 'stranger'    
print(f'Hi there, {name}')

launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Hello World",
            "type": "python",
            "justMyCode": true,
            "request": "launch",
            "program": "${workspaceFolder}/build/bin/helloWorld.py",
            "args": ["Steven"],
            "console": "integratedTerminal",
            "cwd": "${workspaceFolder}"
        }
    ]
}

The runs without issue from the TERMINAL window: steven@DEVELOPMENT-JETSON:~/Projects/test-python/helloWorld/build/bin$ ./helloWorld.py steven

Length : 2
Argv[1]: steven
Hi there, steven

Attempted 3 Different run attempts in Visual Studio Code:

A. right clicked on helloWorld.py from the Explorer window>> Clicked [Run Python File in Terminal]
   Application runs in TERMINAL window and errors out as expected. 
   Application required an argument e.g $./helloWorld.py Steven. No where to 
   add a parm.
B. clicked Run >> clicked Run without debugging 
   Nothing happens except the debug window flashes on then off.
C. clicked Run >> clicked Start Debugging
   Same result as B

Attached is a image of the Explorer window to show directory locations and break points:

enter image description here

0

2 Answers 2

2

enter image description here

enter image description here

There is no problem using debug for me.

You can try debugging like the picture.

Sign up to request clarification or add additional context in comments.

3 Comments

I upgraded Visual Studio code from version 1.66 to 1.67.2 on my Jetson Nano and the debug processor works when using VSC directly on the Jetson. The version of VSC on both my Windows desktop and Jetson Nano are identical now. However, remote debugging (original issue) from Visual Studio Code on my Windows platform continues to be a problem. The debug process seems to terminate without any error messages, and the debug window disappears. Must be an issue kicking off the debug process from a remote VSC session. Any ideas?
@Steven Have you read the document about SSH. I cannot reproduce your problem. I think there may be a problem with the configuration. code.visualstudio.com/docs/python/…
Yes, I have read this. On one attempt to debug remotely, a time out error message appeared, similar to one of the issues noted on your link - 4th issue under Trouble shooting. At this point, I'm left with debugging python directly on the Jetson, a work around. Maybe in the future, I will discover a fix. More information, I have no issue debugging remotely with C++ or Nvidia cuda-gdb. Thank you very much for your suggestions and time spent!
0

After more research, I found that setting the Interpreter to Python 3.6.9-bit /usr/bin/python3 allowed VSC to enter debug mode. I was using the "Recommended" version. I don't know why VSC required the 3.6.9 version instead of the 3.7.9. I do have the 3.7.9 installed on the jetson.

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.