# Debugging nameko services with Visual Studio Code

**URL:** https://discourse.nameko.io/t/debugging-nameko-services-with-visual-studio-code/238
**Category:** googlegroup
**Created:** [February 13, 2018, 2:06pm UTC](https://discourse.nameko.io/t/debugging-nameko-services-with-visual-studio-code/238 "2018-02-13T14:06:44Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Tuan\_Anh\_Le](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@Tuan\_Anh\_Le](https://discourse.nameko.io/u/Tuan_Anh_Le)
#### Post date: [February 15, 2018, 1:12pm UTC](https://discourse.nameko.io/t/debugging-nameko-services-with-visual-studio-code/238/2 "2018-02-15T13:12:22Z")

</div>

Your launch.json should just have "program" set to the path to nameko  
(`which nameko`), otherwise that should just work? Then you can hit debug  
in vscode.

So something like an entry in vscode's launch.json:

{  
&nbsp;&nbsp;(other standard python configs)  
&nbsp;&nbsp;"program": "/path/to/nameko",  
&nbsp;&nbsp;"args": [  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"run",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"\<blargh\>"  
&nbsp;&nbsp;&nbsp;]  
}

> **···**
>
> On Tuesday, February 13, 2018 at 2:06:44 PM UTC, Chris Platts wrote:
> 
> > Hi,
> > 
> > After lots of manual 'nameko run' runs, a lot of Ctrl+C'ing and an  
> > unpleasant amount of debug-by-print()'ing, I'm trying to get a decent  
> > configuration sorted in my IDE (Visual Studio Code, with Python extension  
> > installed.)
> > 
> > In case you've not tried vscode (it's quite good!), it allows  
> > configuration of launch profiles. For Python code, this wants:
> > 
> > a) The path to python.exe  
> > b) The 'program' -- i.e., what's passed to python.exe on the command-line  
> > c) Program arguments  
> > d) Other misc. optional stuff (e.g. a launchTask to execute before  
> > debugging starts, arguments for the program, etc.)
> > 
> > ...plus, it can do stuff like attach to a running Python
> > 
> > I'm trying to simulate `nameko run --config=config.yml service`, but with  
> > vscode attached to the process to hit breakpoints, allow watches, etc.
> > 
> > Has anyone had any luck with this (or indeed, with a different IDE? The  
> > principles would be the same...)
> > 
> > I tried using vscode's ability to attach to processes, but the debugger  
> > crashes when connecting to nameko's --backdoor-port.
> > 
> > Or am I over-thinking this, and it's best just to add a \_\_main()\_\_ to the  
> > service's module and spin up a container/runner/etc. from there?

---

_[View the full topic](https://discourse.nameko.io/t/debugging-nameko-services-with-visual-studio-code/238)._
