Visual Studio Code debug python

houdini

#1

I’m trying to configure Visual Studio Code to write and debug my python for maya scripts.
Did someone achieve this?
I just found this https://iwonderwhatjoeisworkingon.blogspot.fr/2017/04/debugging-maya-using-visual-studio-code.html?showComment=1501955737679#c66976449976339243
but seems it doesn’t work
Thanks

Maybe could be useful to add a step by step guide on how to configure different Ide with Maya-3ds max etc.
Or maybe we have already this in our wiki


#2

There are threads on here for PyCharm and Wing and I think Python Tools for Visual Studio


#3

If I remember correctly, at least one of the python plugins for VSCode used some of the remote debugging code for PTVS. So there should be some overlap there.


#4

I messed with this for a while but I believe the final road block before I gave up was configuring the python interpreter to locate mayapy.exe. You can configure your interpreter directory but I believe the python extension natively looks for python.exe. I also tried a junction and renamed mayapy to python.exe just to test but no luck.

I tried each of the top 2 python extensions in the VS Code Marketplace.


#5

Why use VS for Python? What does VS have that either PyCharm or Wing doesn’t provide?

PyCharm, imho, hands down the best IDE for python dev and debugging. Being able to look at my history of code, code refactoring, PEP8 compliant…there’s a lot more pluses than negatives.


#6

Hi Snolan,

Last time I tried PyCharm I wasn’t able to set hython as interpreter because it wasn’t a “valid python interpreter”, where I can do it in VS or eclipse. Do you know if it’s still the case ?


#7

I haven’t tried to setup an external editor for Houdini. The little bit of python I’ve done in there is within Houdini so I’m not going to much help with that. Maybe someone else reading this can chime in. I’d be keen to know myself :slight_smile:


#8

I’ve evaluated eclipse, pycharm and vscode for maya. While each has their strengths and weaknesses, I prefer VS Code because a) the interface, shortcuts, etc are the same as Visual Studio which is my primary IDE and b) for a script IDE it strikes a great balance of being pretty feature complete while also being very lightweight/nimble. That’s my 2c anyway

I also find that I get a lot of APPCRASH errors from mayapy.exe while building the python skeletons in PyCharm. Haven’t been able to figure out why