# Python debugger not working with pycharm64

**URL:** <https://discourse.slicer.org/t/python-debugger-not-working-with-pycharm64/8395>\
**Category:** Support\
**Tags:** python\
**Created:** [September 12, 2019, 2:23am UTC](https://discourse.slicer.org/t/python-debugger-not-working-with-pycharm64/8395 "2019-09-12T02:23:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ungi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ungi/32/78573_2.png) [@ungi](https://discourse.slicer.org/u/ungi)\
**Post date:** [September 12, 2019, 2:23am UTC](https://discourse.slicer.org/t/python-debugger-not-working-with-pycharm64/8395/1 "2019-09-12T02:23:09Z")

</div>

I’ve installed a new version of PyCharm, and tried to set up Python debugger in Slicer. But I got the error message below. I tried to find the missing registry entry, but noticed that I don’t have a pycharm.exe file, only a pycharm64.exe, with matching registry entry. Is it possible that Python debugger module needs to be updated to look for pycharm64.exe as well as pycharm.exe?

I use Slicer 4.10.

SystemError: D:\D\S\Slicer-4100-build\Python-2.7.13\Objects\classobject.c:521: bad argument to internal function  
Traceback (most recent call last):  
File “C:/Users/tamas/AppData/Roaming/NA-MIC/Extensions-27501/DebuggingTools/lib/Slicer-4.10/qt-scripted-modules/PyDevRemoteDebug.py”, line 199, in onDebuggerSelected  
eggDir=self.logic.getPyCharmDebugEggPath(enableAutoDetect=True)  
File “C:/Users/tamas/AppData/Roaming/NA-MIC/Extensions-27501/DebuggingTools/lib/Slicer-4.10/qt-scripted-modules/PyDevRemoteDebug.py”, line 489, in getPyCharmDebugEggPath  
aKey = \_winreg.OpenKey(aReg, r"Applications\pycharm.exe\shell\open\command")  
WindowsError: [Error 2] The system cannot find the file specified

---

<div class="post-metadata">

**Author:** ![ungi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ungi/32/78573_2.png) [@ungi](https://discourse.slicer.org/u/ungi)\
**Post date:** [September 12, 2019, 2:30am UTC](https://discourse.slicer.org/t/python-debugger-not-working-with-pycharm64/8395/2 "2019-09-12T02:30:48Z")

</div>

I’ve created a registry entry called ‘pycharm.exe’ and copied the same values inside. Now I don’t get the above error message. But I hit another problem. I don’t have a “pycharm-debug.egg”. I only have this single egg file:  
“c:\Program Files\JetBrains\PyCharm 2019.2.1\debug-eggs\pydevd-pycharm.egg”  
Maybe they renamed this file in the new PyCharm?

---

<div class="post-metadata">

**Author:** ![ungi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ungi/32/78573_2.png) [@ungi](https://discourse.slicer.org/u/ungi)\
**Post date:** [September 12, 2019, 2:32am UTC](https://discourse.slicer.org/t/python-debugger-not-working-with-pycharm64/8395/3 "2019-09-12T02:32:57Z")

</div>

I’ve copied pydevd-pycharm.egg and renamed it pycharm-debug.egg.  
Now, the debugger works. So, searching for these new names, or asking the user to input these values would probably solve the problem.

---

<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:** [September 12, 2019, 9:15pm UTC](https://discourse.slicer.org/t/python-debugger-not-working-with-pycharm64/8395/4 "2019-09-12T21:15:47Z")

</div>

Thanks for reporting. These have been all fixed in recent versions of the DebuggingTools extension (available for latest stable 4.10.2 and recent preview releases but not for older Slicer releases such as 4.10.0).
