# Cannot attach Python Debugger from Visual Studio 2017

**URL:** <https://discourse.slicer.org/t/cannot-attach-python-debugger-from-visual-studio-2017/10495>\
**Category:** Development\
**Created:** [March 2, 2020, 3:11pm UTC](https://discourse.slicer.org/t/cannot-attach-python-debugger-from-visual-studio-2017/10495 "2020-03-02T15:11:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rprueckl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rprueckl/32/4240_2.png) [@rprueckl](https://discourse.slicer.org/u/rprueckl)\
**Post date:** [March 2, 2020, 3:11pm UTC](https://discourse.slicer.org/t/cannot-attach-python-debugger-from-visual-studio-2017/10495/1 "2020-03-02T15:11:28Z")

</div>

Hi, I tried to debug a custom python scripted module using Visual Studio 2017.

I use Slicer 4.11.0-2020-02-26 and installed the python debugger module.

I followed these steps: [Documentation/Nightly/Extensions/DebuggingTools - Slicer Wiki](https://www.slicer.org/wiki/Documentation/Nightly/Extensions/DebuggingTools#Debugging_in_VisualStudio)

In Visual Studio, I created my SlicerPython environment:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/7/67ac1664b4c3a0fe2872c0935beb1dc3a71f136d.png)

I click 'Connect to VisualStudio 2017 debugger" in the module.

When I try to attach, an error is displayed:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/4/e40d0ce654ce1a84afc54ca1ee5c5c4103ba05d4.png)

The packages for my python environment show the ptvsd:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/0/806ed3542a4d2216759668a72630864c70b693cb.png)

I don’t know what I am doing wrong, please help.

---

<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:** [March 2, 2020, 7:17pm UTC](https://discourse.slicer.org/t/cannot-attach-python-debugger-from-visual-studio-2017/10495/2 "2020-03-02T19:17:04Z")

</div>

It seems that Python tools were updated in VS2017. Could you try if you can connect if you choose “Visual Studio Code” as debugger in Slicer?
