How to debug a remote python application with (Python Tools for) Visual Studio?

Question:

According to http://pytools.codeplex.com/, PTVS supports “Local and remote debugging”. However, I couldn’t find anything related to it or.

So I’m curious if their “remote debugging” is simply attaching to a running process on the same machine or if there’s some actual remote debugging support over TCP/IP available. I’d like to use PTVS for a WSGI-based web applications running on apache on another (linux) machine, but without a proper remote debugger (such as WinPDB, which is not that bad but sonmething integrated in the IDE would be better) it’s not really useful…

Asked By: ThiefMaster

||

Answers:

There’s a couple of different ways to get into remote debugging. The main scenario is probably our MPI cluster debugging. There you can create a new MPI project, set it up to launch to the Windows HPC cluster, and we’ll deploy everything needed onto the cluster and setup the remote debugging session.

The “deploy everything needed” part though can be done on your own for normal remote debugging scenarios. This is more or less just standard VS remote debugging with the addition of having PTVS installed. The basic steps for this are:
1) Install the Visual Studio remote debugger components on the remote machine
2) Install PTVS onto the remote machine
3) Start the VS remote debugger monitor (msvsmon)

Then you can do Debug->Attach to Process, select the machine, and start debugging.

Answered By: Dino Viehland

Yes, for remote debugging you do need VS + PTVS installed on the remote machine currently, which implies windows only. If you want to see this feature implemented, vote for this ticket here (which also has a few details on the situation):
http://pytools.codeplex.com/workitem/536

Answered By: benpmorgan

Remote debugging for platforms other than Windows was not available until 2.0 alpha release, but it is possible now – see the documentation or the video tutorial for details.

Answered By: Pavel Minaev