PyCharm remote debugging Maya question

qt

#1

I have successfully got PyCharm up and running with Maya2013. I’m pretty convinced I like it more than Wing (though that’s another thread). PyCharm is auto-completing fine and is tripping breakpoints while remote debugging, yay! What I can’t figure out, is whenever an error is raised within source code, or if you attempt to step into the last line of the file (which should return you to back maya), you are instead greeted with popup tab entitled, “<maya console>” containing the following text:

c:/program files/autodesk/maya2013/bin/ can’t be found in project
You can continue degging, but withtout the source.
To filx this you can do one of the following:
Edit settings of path mapping in remote debug configuration
Auto-detect path mapping settings
Download source from remote host

Of these three options, the only viable possibility is editing the remote config manually. I’ve attempted to map c:/program files/autodesk/maya2013/bin/ to itself, but obviously this is wrong because that doesn’t work. Does anyone know how to circumvent this console warning tab, or what I’m not understanding mapping wise? Switching from this warning tab, back into the source code tab and continuing to step through the code continues to work as you’d expect… I just would like this console warning tab to quit showing up.

Anyone?

-csa


#2

Do you have the instructions you followed to get PyCharm debugging working in Maya? I’d love to get it set up here and tell you what I find.


#3

This issue fixed in PyCharm, 2.6.2, ?? http://youtrack.jetbrains.com/issue/PY-7453

Haven´t done hard testing just a couple of PyQt scripts worked fine, I remember that in 2.5 somehow it stop doing this but I don’t know what I did, it was just luck, however installing 2.6.1 got me the problem back again.


Rob for the debugging just add a new remote debugger, follow the instructions in the same window.

i.e.

Copy “pycharm-debug.egg” from C:\Program Files (x86)\JetBrains\PyCharm 2.6.1\ to C:\Program Files\Autodesk\Maya2013\Python\Lib\site-packages\

Add this lines to the beginning of your script, replacing paths and the options you choose for your own ones, (just check the remote debugging window)

import sys
sys.path.append('C:\Program Files\Autodesk\Maya2013\Python\lib\site-packages\pycharm-debug.egg')
from pydev import pydevd
pydevd.settrace('127.0.0.1', port=49586, stdoutToServer=True, stderrToServer=True)

Now run the remote debugger, with the green bug icon.

Start your script in maya, or use the JRuby code in the other post.

Step over or use breakpoints, whatever… :smiley:

By the way there is an issue with the debugger, there is a stop trace feature missing, so if you stop your debugger, you have to restart maya to be able to connect again.
More info here: http://youtrack.jetbrains.com/issue/PY-4711
Cheers!


#4

I am currently setting up pyCharm too and I have had the same experiences as you guys. Currently it’s better not to stop the debug manually, but have the script finish it. Else it locks up the application that started the thread.

I also found that I had to extract the .egg file with 7zip for the debugger to start working. I also found that the SOURCES.txt in the .egg file is incomplete and have reported it.

I also found that in order to get breakpoints to work when deploying the code somewhere else (e.g. I have my code in my projects directory and then deploy it to my maya/scripts directory), the path mapping has to be provided explicitly in the debug config.

What I cannot find out, is why when I execute a script from within Maya and the debugger halts on a breakpoint, pyCharm loads the deployed file and not the local file. Is there a trick to get that fixed up, too?

Edit: Re first post: you could try suspend=False?


#5

I posted how I setup PyCharm over on this thread if it helps anyone.

-csa