# Use Pycharm Debugger when Dash app is running

**URL:** <https://community.plotly.com/t/use-pycharm-debugger-when-dash-app-is-running/17738>\
**Category:** Dash Python\
**Created:** [January 7, 2019, 6:21pm UTC](https://community.plotly.com/t/use-pycharm-debugger-when-dash-app-is-running/17738 "2019-01-07T18:21:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jajarbins](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jajarbins/32/5465_2.png) [@jajarbins](https://community.plotly.com/u/jajarbins)\
**Post date:** [January 7, 2019, 6:21pm UTC](https://community.plotly.com/t/use-pycharm-debugger-when-dash-app-is-running/17738/1 "2019-01-07T18:21:31Z")

</div>

Hey there,

I’m new to web development so my Flask understanding is very limited. I don’t even know if my question is naive or not.

I would like to be able to use Pycharm debugger when my dash webapp is running in the browser

For example, in my Dash-app, I do API call to load data. Is it possible to set a breakpoint on the line of the API call and launch the Pycharm debugger when that line is used?

Thanks in advance for anyone responding,

---

<div class="post-metadata">

**Author:** ![pmoran](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@pmoran](https://community.plotly.com/u/pmoran)\
**Post date:** [January 7, 2019, 9:56pm UTC](https://community.plotly.com/t/use-pycharm-debugger-when-dash-app-is-running/17738/2 "2019-01-07T21:56:19Z")

</div>

Works Great!

 ![dash_w_pycharm](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/f/f0a02dcc088d9d7c90d37bf2ef58f951a1649c74.png)

---

<div class="post-metadata">

**Author:** ![jajarbins](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jajarbins/32/5465_2.png) [@jajarbins](https://community.plotly.com/u/jajarbins)\
**Post date:** [January 8, 2019, 10:35am UTC](https://community.plotly.com/t/use-pycharm-debugger-when-dash-app-is-running/17738/4 "2019-01-08T10:35:29Z")

</div>

Thanks pmoran, could you also upload a picture of your Run/Debug Configuration please 🙂

---

<div class="post-metadata">

**Author:** ![pmoran](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@pmoran](https://community.plotly.com/u/pmoran)\
**Post date:** [January 8, 2019, 5:20pm UTC](https://community.plotly.com/t/use-pycharm-debugger-when-dash-app-is-running/17738/5 "2019-01-08T17:20:10Z")

</div>

Sure here it is:  
Note that I use Python 3.6 in a virtual env.  
The requirements.txt is

> dash==0.34.0 # The core dash backend  
> dash-html-components==0.13.4 # HTML components  
> dash-core-components==0.42.0 # Supercharged components  
> dash-table==3.1.11 # Interactive DataTable component (new!)  
> pandas  
> plotly

 ![runconfig](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/1/1a53756d7efb9c436751787c5398e456d0f35102.png)

---

<div class="post-metadata">

**Author:** ![jajarbins](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jajarbins/32/5465_2.png) [@jajarbins](https://community.plotly.com/u/jajarbins)\
**Post date:** [January 8, 2019, 5:34pm UTC](https://community.plotly.com/t/use-pycharm-debugger-when-dash-app-is-running/17738/6 "2019-01-08T17:34:22Z")

</div>

Thanks a lot!! It wasn’t working for me, breakpoints were not triggering the Pycharm debugger.

I have fixed this, but I’m not sure what was wrong because I didn’t have to change anything for it to work. I just tried lots of different stuff and when I went back to my original setting (same as yours), it suddenly worked…

---

<div class="post-metadata">

**Author:** ![aghosal](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@aghosal](https://community.plotly.com/u/aghosal)\
**Post date:** [November 30, 2020, 3:52pm UTC](https://community.plotly.com/t/use-pycharm-debugger-when-dash-app-is-running/17738/7 "2020-11-30T15:52:23Z")

</div>

Did u ever figure out what went wrong … i am having the same problems where the breakpoints after the plotly call to make\_subplots are not working … the breakpoint just before that works fine! Thanks Anjan

---

<div class="post-metadata">

**Author:** ![urig](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/urig/32/16882_2.png) [@urig](https://community.plotly.com/u/urig)\
**Post date:** [November 1, 2021, 2:51pm UTC](https://community.plotly.com/t/use-pycharm-debugger-when-dash-app-is-running/17738/8 "2021-11-01T14:51:25Z")

</div>

For me, the debugger crashes with this traceback:

```auto
...\.venv\Scripts\python.exe "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2021.1.3\plugins\python-ce\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 54662 --file ...results/dashboard/dashboard.py
Connected to pydev debugger (build 212.4746.96)
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2021.1.3\plugins\python-ce\helpers\pydev\pydevd.py", line 1483, in _exec
    pydev_imports.execfile(file, globals, locals) # execute the script
  File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2021.1.3\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "C:/dev/github/urig/entropy/entropylab/results/dashboard/dashboard.py", line 93, in <module>
    _app = dash.Dash( __name__ )
  File "C:\dev\github\urig\entropy\.venv\lib\site-packages\dash\dash.py", line 304, in __init__
    self.server = flask.Flask(name) if server else None
  File "C:\dev\github\urig\entropy\.venv\lib\site-packages\flask\app.py", line 406, in __init__
    instance_path = self.auto_find_instance_path()
  File "C:\dev\github\urig\entropy\.venv\lib\site-packages\flask\app.py", line 638, in auto_find_instance_path
    prefix, package_path = find_package(self.import_name)
  File "C:\dev\github\urig\entropy\.venv\lib\site-packages\flask\scaffold.py", line 850, in find_package
    package_path = _find_package_path(root_mod_name)
  File "C:\dev\github\urig\entropy\.venv\lib\site-packages\flask\scaffold.py", line 801, in _find_package_path
    return os.path.dirname(next(iter(spec.submodule_search_locations)))
TypeError: 'NoneType' object is not iterable
python-BaseException

```

This is on PyCharm Community Edition 2021.1.3, dash v2.0.0

Would appreciate any ideas on how to fix. Thanks!
