# Basic PyCharm Importation Analysis for Slicer Development

**URL:** <https://discourse.slicer.org/t/basic-pycharm-importation-analysis-for-slicer-development/8509>\
**Category:** Development\
**Tags:** python\
**Created:** [September 20, 2019, 5:34pm UTC](https://discourse.slicer.org/t/basic-pycharm-importation-analysis-for-slicer-development/8509 "2019-09-20T17:34:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![evan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/evan/32/4953_2.png) [@evan](https://discourse.slicer.org/u/evan)\
**Post date:** [September 20, 2019, 5:34pm UTC](https://discourse.slicer.org/t/basic-pycharm-importation-analysis-for-slicer-development/8509/1 "2019-09-20T17:34:01Z")

</div>

After searching the web, I found that it is not currently possible to gain full IDE code-completion/analysis for Slicer python development as some packages are added at run-time.

I was able to gain some package importation analysis (resulting in the removal of many false errors and warnings) by the following:

1. In PyCharm open your Slicer project of choice
2. In the menu-bar, open **File** \> **Settings**
3. In Settings, click **Project: \_\_\_\_** \> **Project Interpreter**
4. Next to Project Interpreter click ⚙ \> **Add**
5. Navigate to and select **Slicer installation directory** \ **bin** \ **PythonSlicer.exe**

The following should appear:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/3/c395f6ee0f78b303382cd820174707aa0aea450e.png)  
PyCharm will now interpret using Slicer’s included python binary. I would not recommend updating or adding packages. However, I did find it useful to add the Python 2.7 PyQt package as a reference module, as it offers full PyQt code-completion. Remembering to remove this manually added package and point to Slicer’s PyQt (import qt) before deployment.

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [September 20, 2019, 8:25pm UTC](https://discourse.slicer.org/t/basic-pycharm-importation-analysis-for-slicer-development/8509/2 "2019-09-20T20:25:38Z")

</div>

As a clarification, Slicer uses [PythonQt](https://mevislab.github.io/pythonqt/) and not [PyQt](https://riverbankcomputing.com/software/pyqt/intro). They are similar, but if you run into python related Qt issues make sure to look into the correct source. Slicer uses PythonQt as included in CTK [https://github.com/commontk/PythonQt](https://github.com/commontk/PythonQt).
