# Can I use Pycharm as the IDE and for debugging?

**URL:** <https://forum.compas-framework.org/t/can-i-use-pycharm-as-the-ide-and-for-debugging/195>\
**Category:** getting started\
**Created:** [June 11, 2019, 6:59pm UTC](https://forum.compas-framework.org/t/can-i-use-pycharm-as-the-ide-and-for-debugging/195 "2019-06-11T18:59:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Golvk](https://avatars.discourse-cdn.com/v4/letter/g/7c8e57/32.png) [@Golvk](https://forum.compas-framework.org/u/Golvk)\
**Post date:** [June 11, 2019, 6:59pm UTC](https://forum.compas-framework.org/t/can-i-use-pycharm-as-the-ide-and-for-debugging/195/1 "2019-06-11T18:59:45Z")

</div>

Hi there, I’m very new to COMPAS and just installed it through Conda. I was wondering if I can use COMPAS with Pycharm IDE or if not what IDE do you suggest, especially for debugging?

Thanks

---

<div class="post-metadata">

**Author:** ![kiunana](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@kiunana](https://forum.compas-framework.org/u/kiunana)\
**Post date:** [June 12, 2019, 4:02pm UTC](https://forum.compas-framework.org/t/can-i-use-pycharm-as-the-ide-and-for-debugging/195/2 "2019-06-12T16:02:04Z")

</div>

I’ve been using COMPAS in PyCharm. It was the first time for using both COMPAS and PyCharm - so I don’t have any comparative idea on how good this paring is. But it has worked well so far.

---

<div class="post-metadata">

**Author:** ![yijiangh](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/yijiangh/32/56_2.png) [@yijiangh](https://forum.compas-framework.org/u/yijiangh)\
**Post date:** [June 13, 2019, 7:19am UTC](https://forum.compas-framework.org/t/can-i-use-pycharm-as-the-ide-and-for-debugging/195/3 "2019-06-13T07:19:52Z")

</div>

I have a related question in terms of the workflow:

Let’s say I have a piece of python module that is dependent on compas. And I use a grasshopper script to load this module and test it with some geometries.

Is there a way that I can code my python module in an IDE like pycharm, and at the same time trigger GH to reload the script that I am working on **without restart Rhino**?  
(I’m sure there must be a way to do this… Please let me know if I miss anything!)

---

<div class="post-metadata">

**Author:** ![franaudo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/franaudo/32/107_2.png) [@franaudo](https://forum.compas-framework.org/u/franaudo)\
**Post date:** [June 16, 2019, 12:21pm UTC](https://forum.compas-framework.org/t/can-i-use-pycharm-as-the-ide-and-for-debugging/195/4 "2019-06-16T12:21:51Z")

</div>

Yes you can use any IDE you prefer. I do use compas with both PyCharm and Visual Studio Code. If you are already familiar with PyCharm then go for it, otherwise I would suggest you to use Visual Studio Code or Sublime: they are more lightweight and easier to configure.

---

<div class="post-metadata">

**Author:** ![franaudo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/franaudo/32/107_2.png) [@franaudo](https://forum.compas-framework.org/u/franaudo)\
**Post date:** [June 16, 2019, 12:26pm UTC](https://forum.compas-framework.org/t/can-i-use-pycharm-as-the-ide-and-for-debugging/195/5 "2019-06-16T12:26:04Z")

</div>

I don’t know how to do it for GH, but if you are using visual studio code and you want to run python scripts in rhino directly from the IDE, you may want to check this extension: [https://marketplace.visualstudio.com/items?itemName=designtoproduction.rhinopython](https://marketplace.visualstudio.com/items?itemName=designtoproduction.rhinopython)

---

<div class="post-metadata">

**Author:** ![gonzalocasas](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/gonzalocasas/32/127_2.png) [@gonzalocasas](https://forum.compas-framework.org/u/gonzalocasas)\
**Post date:** [June 16, 2019, 12:39pm UTC](https://forum.compas-framework.org/t/can-i-use-pycharm-as-the-ide-and-for-debugging/195/6 "2019-06-16T12:39:39Z")

</div>

@yijiangh the designtoproduction extension for VS Code is definitely one option, but this can also be done programmatically using `compas_ghpython.utilities.unload_modules`. The `unload_modules` function takes a string as argument and it unloads all loaded python modules that **start with** that string.

A typical workflow would then be to add a call to that at the top of the script you’re working on, so that it gets reloaded on each execution. Let’s say you have are working on a module named `foo.bar`, at the very top of it, you can have:

```python
from compas_ghpython.utilities import unload_modules
unload_modules('foo.bar')

# here the rest of your imports and code
# ..

```

Hope it helps!
