Just realized that the second snapshot is too small...
Here is the code that I put:
import sys
import os
#os.path.expanduser("~") expands to the User's documents folder when used 
inside Maya, but expands to the user's root folder when run in a CPython 
installation.
sys.path.append(os.path.abspath(fr'{os.path.expanduser("~")}\..\.vscode\extensions\ms-python.python-2022.20.2\pythonFiles\lib\python'))

import debugpy
#overwrite the default python executabledebugpy.breakpoint()

maya_location = os.path.join(os.environ.get("MAYA_LOCATION"), "bin", 
"mayapy.exe")
debugpy.configure({'python': maya_location})

# 5678 is the default attach port in the VS Code debug configurations. 
Unless a host and port are specified, host defaults to 127.0.0.1
debugpy.listen(5678)
print("Waiting for debugger attach")
debugpy.wait_for_client()
print('break on this line')


On Friday, January 27, 2023 at 6:27:58 AM UTC+8 Mengjing Yang wrote:

> Hello guys,
>
> I'm learning how to remote debug using VSCode, but got error message when 
> trying to create a polyCube.
> [image: debugFail.jpg]
>
> These are what I've done:
> 1.download and unzip debugpy in maya scripts folder
> 2.run following code in maya script editor
> [image: debugFail2.jpg]
> 3.set maya python debugger in VSCode launch.json 
> [image: debugFail3.jpg]
> 4.start debugging
>
> Anyone notice anything I'm missing here?
> Thanks a lot in advance~
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/7711d89e-bb6f-496d-8335-fcfd1c4aae81n%40googlegroups.com.

Reply via email to