# Python Debugging in Visual Studio 2017 (ptsvd)

**URL:** <https://discourse.slicer.org/t/python-debugging-in-visual-studio-2017-ptsvd/2814>\
**Category:** Development\
**Created:** [May 14, 2018, 1:33pm UTC](https://discourse.slicer.org/t/python-debugging-in-visual-studio-2017-ptsvd/2814 "2018-05-14T13:33:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcfly3001](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mcfly3001/32/6437_2.png) [@mcfly3001](https://discourse.slicer.org/u/mcfly3001)\
**Post date:** [May 14, 2018, 1:33pm UTC](https://discourse.slicer.org/t/python-debugging-in-visual-studio-2017-ptsvd/2814/1 "2018-05-14T13:33:08Z")

</div>

Hi all,

I am quite new to slicer development and I am trying to create a small slicelet in Python. Therefore I was trying to attach the debugger in Visual Studio 2017 as described here:

[https://www.slicer.org/wiki/Documentation/Nightly/Extensions/DebuggingTools#Debugging\_in\_VisualStudio](https://www.slicer.org/wiki/Documentation/Nightly/Extensions/DebuggingTools#Debugging_in_VisualStudio)

When trying to attach though I also end up with the error “…make sure that ptvsd.enable\_attach() has been called…”.  
I tried to use the Python Debugger extension as well as manually calling “enable\_attach” and “wait\_for\_attach”. I also tried the release as well the nightly version of Slicer. I also made sure to have the newest version of ptvsd which is 3.2.1.

Any ideas what could be wrong here? Or is VS2017 simply not supported?

Thanks!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 14, 2018, 4:14pm UTC](https://discourse.slicer.org/t/python-debugging-in-visual-studio-2017-ptsvd/2814/2 "2018-05-14T16:14:54Z")

</div>

Visual Studio remode debugging server version (ptvsd-2.2) that was bundled with the DebuggingTools extension was only compatible with Visual Studio 2013 and 2015. I’ve now added ptvsd-3.2.1 as well, so now you can use VS2017, too. The updated extension will be available in tomorrow’s nightly build or you can [download it now from github](https://github.com/SlicerRt/SlicerDebuggingTools).

---

<div class="post-metadata">

**Author:** ![mcfly3001](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mcfly3001/32/6437_2.png) [@mcfly3001](https://discourse.slicer.org/u/mcfly3001)\
**Post date:** [June 25, 2018, 1:24pm UTC](https://discourse.slicer.org/t/python-debugging-in-visual-studio-2017-ptsvd/2814/3 "2018-06-25T13:24:17Z")

</div>

Thanks for updating the ptvsd. I will give it a try asap!
