You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import cube
# Error: RuntimeError: file C:\Program Files\Autodesk\Maya2020\Python\lib\site-packages\debugpy\server\api.py line 224: timed out waiting for adapter to connect #
I don't really have Maya to test and it seems to work for me in the usual attach to port 5678... Do you know which Python version is Maya using?
One thing to try: replace localhost with 127.0.0.1 (both in the launch and in debugpy.listen).
If it doesn't work, please provide the logs (from Maya and from VSCode).
To get the logs from Maya, you should be able to do something as:
import debugpy
debugpy.log_to('c:/temp')
To get the logs from VSCode:
Open VS Code
Select the command Extensions: Open Extensions Folder
Locate the Python extension directory, typically of the form ms-python.python-2020..***
In that directory ensure you do not have any debug*.log files, if you do, please delete them
Go back into VS Code and modify your launch.json to add the setting "logToFile": true to the attach, see below:
"version": "0.2.0",
"configurations": [
{
"name": "Python Attach to 5678",
"type": "python",
"request": "attach",
"port": 5678,
"host": "127.0.0.1",
"logToFile": true,
},```
* Start debugging
* When done, go back into the extension directory and upload the debug*.log files into this GitHub issue.
We had a collaborative debug session about this, and it's pretty complicated (there are various things that seem to not work in Maya). I'll investigate it further.
As a note, I believe that plain pydevd does work in Maya using the remote attach (from reports I got in the past), so, my hunch is that this is related to launching the secondary adapter process/connecting to it, but if it turns out you need something on the pydevd side, please let me know.
I'm running into a similar problem with our own application that embeds python.
The issue seems to be that debugpy.listen spawns a subprocess using sys.executable which will fail for Maya/Max/Our Tool. Because these aren't standard python processes that accept standard python arguments.
It would be nice if we could specify a python-process instead.
In fact, just changing sys.executable in the listen function to 'python' was enough for me to get vs_code to connect properly. Not sure how true this is for other programs, I haven't tested Max/Maya.
I was considering the same approach, pointing it at the Max specific python exe.
Haven't had a chance to test yet.
If it is possible, it would be great to have this be exposed as a setting.
Activity
fabioz commentedon Jul 16, 2020
I don't really have Maya to test and it seems to work for me in the usual attach to port
5678... Do you know which Python version is Maya using?One thing to try: replace
localhostwith127.0.0.1(both in the launch and indebugpy.listen).If it doesn't work, please provide the logs (from Maya and from VSCode).
To get the logs from Maya, you should be able to do something as:
To get the logs from VSCode:
int19h commentedon Jul 16, 2020
We had a collaborative debug session about this, and it's pretty complicated (there are various things that seem to not work in Maya). I'll investigate it further.
fabioz commentedon Jul 16, 2020
As a note, I believe that plain
pydevddoes work inMayausing the remote attach (from reports I got in the past), so, my hunch is that this is related to launching the secondary adapter process/connecting to it, but if it turns out you need something on thepydevdside, please let me know.luabud commentedon Jul 20, 2020
FWIW Maya uses Python 2.7 😅 and I manually added debugpy to site-packages because they seem to use some sort of custom Python.
munkybutt commentedon Jul 28, 2020
Are there any updates on this?
I am having the same problem in 3DsMax using debugpy where as pydevd used to work without issue.
daniele-niero commentedon Jul 30, 2020
Same here
bob-white commentedon Aug 25, 2020
I'm running into a similar problem with our own application that embeds python.
The issue seems to be that
debugpy.listenspawns a subprocess usingsys.executablewhich will fail for Maya/Max/Our Tool. Because these aren't standard python processes that accept standard python arguments.It would be nice if we could specify a python-process instead.
In fact, just changing
sys.executablein the listen function to'python'was enough for me to get vs_code to connect properly. Not sure how true this is for other programs, I haven't tested Max/Maya.RockShea commentedon Aug 25, 2020
I was considering the same approach, pointing it at the Max specific python exe.
Haven't had a chance to test yet.
If it is possible, it would be great to have this be exposed as a setting.
int19h commentedon Aug 25, 2020
Ah, that makes sense! It would be #262, then.