# Is it possible to debug Dynamo python code using JetBrains PyCharm?

**URL:** <https://forum.dynamobim.com/t/is-it-possible-to-debug-dynamo-python-code-using-jetbrains-pycharm/15158>\
**Category:** Developers\
**Created:** [September 27, 2017, 3:35pm UTC](https://forum.dynamobim.com/t/is-it-possible-to-debug-dynamo-python-code-using-jetbrains-pycharm/15158 "2017-09-27T15:35:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorge\_Villarroel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jorge_villarroel/32/23619_2.png) [@Jorge\_Villarroel](https://forum.dynamobim.com/u/Jorge_Villarroel)\
**Post date:** [September 27, 2017, 3:35pm UTC](https://forum.dynamobim.com/t/is-it-possible-to-debug-dynamo-python-code-using-jetbrains-pycharm/15158/1 "2017-09-27T15:35:33Z")

</div>

Hi All,

For my Python coding, I’m using **JetBrains PyCharm** (as my IDE) like following:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/d/fd2b2cbf952f7796dc4ff96bab83ddc900aaa359.png)

Is there a way to use the debugger of the **JetBrains PyCharm** to improve error recognition? or just looking the **OUTPUT** through a watch node?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [September 27, 2017, 3:50pm UTC](https://forum.dynamobim.com/t/is-it-possible-to-debug-dynamo-python-code-using-jetbrains-pycharm/15158/2 "2017-09-27T15:50:34Z")

</div>

I don’t think you can get pyCharm to debug the code that ultimately needs to run in Dynamo and Revit environment to be verified. There is no way that I know of, to attach pyCharm to Revit/Dynamo to execute code in debug mode. So, yes, you can debug by watching errors coming out of the python node in Dynamo.

cc: @Gui_Talarico I think you had a workaround for that with the debugger package though. Can you chime in?

---

<div class="post-metadata">

**Author:** ![Jorge\_Villarroel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jorge_villarroel/32/23619_2.png) [@Jorge\_Villarroel](https://forum.dynamobim.com/u/Jorge_Villarroel)\
**Post date:** [September 27, 2017, 3:52pm UTC](https://forum.dynamobim.com/t/is-it-possible-to-debug-dynamo-python-code-using-jetbrains-pycharm/15158/3 "2017-09-27T15:52:59Z")

</div>

Thanks @Konrad_K_Sobon. So, I guess an alternative way could be the explained by @Gui_Talarico in this post:

> [@Debugging Python Code](https://forum.dynamobim.com/t/debugging-python-code/12729):
>
> Made a shinny new development toy, I though it might be useful to a few of you; allows you to launch an interactive console from a breakpoint anywhere in your python code. Demo: More info here: [http://revitpythonwrapper.readthedocs.io/en/latest/forms.html#console](http://revitpythonwrapper.readthedocs.io/en/latest/forms.html#console)

I’ll give it a try.

Thanks!

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [September 27, 2017, 3:55pm UTC](https://forum.dynamobim.com/t/is-it-possible-to-debug-dynamo-python-code-using-jetbrains-pycharm/15158/4 "2017-09-27T15:55:46Z")

</div>

Indeed that’s as close to a debugger as you will get as far as I know. It’s pretty awesome if you ask me.

---

<div class="post-metadata">

**Author:** ![Jorge\_Villarroel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jorge_villarroel/32/23619_2.png) [@Jorge\_Villarroel](https://forum.dynamobim.com/u/Jorge_Villarroel)\
**Post date:** [September 27, 2017, 3:56pm UTC](https://forum.dynamobim.com/t/is-it-possible-to-debug-dynamo-python-code-using-jetbrains-pycharm/15158/5 "2017-09-27T15:56:51Z")

</div>

Yes, great job!

---

<div class="post-metadata">

**Author:** ![Gui\_Talarico](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gui_talarico/32/10887_2.png) [@Gui\_Talarico](https://forum.dynamobim.com/u/Gui_Talarico)\
**Post date:** [September 28, 2017, 4:05am UTC](https://forum.dynamobim.com/t/is-it-possible-to-debug-dynamo-python-code-using-jetbrains-pycharm/15158/6 "2017-09-28T04:05:31Z")

</div>

Added more info on the Console related to pycharm:

> [@Debugging Python Code](https://forum.dynamobim.com/t/debugging-python-code/12729/24):
>
> Hi @Jorge_Villarroel Sorry I missed this msg! Yes, you can use rpw’s console in pycharm just as you would with an embedded script: import sys rpw\_path = r"C:\Users\gtalarico\AppData\Roaming\Dynamo\Dynamo Revit\1.2\packages\RevitPythonWrapper\extra\rpw.zip" # Or any location where rpw.zip is stored. This one ^ was installed with the package manager # but you can also download it form github sys.path.append(rpw\_path) OUT = 'Test' import rpw from rpw.ui.forms import Console # …

For the most part, this Console is good enough for me.  
If you want _true debugging_ (step in/out/over) you can look into pydev or winpdb.  
These both offer remote debugging and are able to communicate remotely with a remote debugging server.

> **[Remote Debugger](https://www.pydev.org/manual_adv_remote_debugger.html)**
>
> PyDev Manual

---

<div class="post-metadata">

**Author:** ![Jorge\_Villarroel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jorge_villarroel/32/23619_2.png) [@Jorge\_Villarroel](https://forum.dynamobim.com/u/Jorge_Villarroel)\
**Post date:** [September 28, 2017, 11:32am UTC](https://forum.dynamobim.com/t/is-it-possible-to-debug-dynamo-python-code-using-jetbrains-pycharm/15158/7 "2017-09-28T11:32:39Z")

</div>

Thanks @Gui_Talarico for taking the time to answer here and the other thread. I’ll give it a try !
