# Running Rasa in Pycharm debugger

**URL:** <https://forum.rasa.com/t/running-rasa-in-pycharm-debugger/14438>\
**Category:** Rasa Open Source\
**Created:** [August 17, 2019, 7:30pm UTC](https://forum.rasa.com/t/running-rasa-in-pycharm-debugger/14438 "2019-08-17T19:30:37Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmm3bbb](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@mmm3bbb](https://forum.rasa.com/u/mmm3bbb)\
**Post date:** [August 17, 2019, 7:30pm UTC](https://forum.rasa.com/t/running-rasa-in-pycharm-debugger/14438/1 "2019-08-17T19:30:37Z")

</div>

I’m trying to run Rasa (not Action server, but Rasa itself) in PyCharm debugger. I an executing rasa module with “run --enable-api --debug --endpoints endpoints.yml” as parameters.

It runs, but clients cannot connect to it. I have tried both socketio and facebook, and they have the same error:

```
[2019-08-17 12:27:14 -0700] [2918] [ERROR] Exception occurred while handling uri: 'http://localhost:5005/socket.io/?EIO=3&transport=polling&t=MoX357R'
Traceback (most recent call last):
  File "/Users/michael/Documents/projects/rasa2/env/lib/python3.6/site-packages/sanic/app.py", line 893, in handle_request
    handler, args, kwargs, uri = self.router.get(request)
  File "/Users/michael/Documents/projects/rasa2/env/lib/python3.6/site-packages/sanic/router.py", line 407, in get
    return self._get(request.path, request.method, "")
  File "/Users/michael/Documents/projects/rasa2/env/lib/python3.6/site-packages/sanic/router.py", line 469, in _get
    raise NotFound("Requested URL {} not found".format(url))
sanic.exceptions.NotFound: Requested URL /socket.io/ not found

```

Has anyone has success with this?

Note that it works fine when running in terminal.

---

<div class="post-metadata">

**Author:** ![fede](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/fede/32/7095_2.png) [@fede](https://forum.rasa.com/u/fede)\
**Post date:** [August 19, 2019, 8:36am UTC](https://forum.rasa.com/t/running-rasa-in-pycharm-debugger/14438/2 "2019-08-19T08:36:52Z")

</div>

Hi @mmm3bbb, could you post the contents of your `endpoints.yml` file, as well as the full output of the `run` command when you run it with `--debug`? Thanks.

---

<div class="post-metadata">

**Author:** ![mmm3bbb](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@mmm3bbb](https://forum.rasa.com/u/mmm3bbb)\
**Post date:** [August 19, 2019, 5:56pm UTC](https://forum.rasa.com/t/running-rasa-in-pycharm-debugger/14438/3 "2019-08-19T17:56:57Z")

</div>

Hi @fede. OK, it was a working directory problem. Your hint to look at --debug helped me figure that out. Thx. However, I do get this message with an error at the end. It still runs though.

```
/Users/michael/Documents/projects/rasa2/env/bin/python /Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py --module --multiproc --qt-support=auto --client 127.0.0.1 --port 59740 --file rasa run --enable-api --debug --endpoints endpoints.yml --credentials credentials.yml
pydev debugger: process 65995 is connecting

Connected to pydev debugger (build 191.6605.12)
2019-08-19 10:50:06 INFO engineio.server - Server initialized for sanic.
2019-08-19 10:50:06 DEBUG rasa.core.utils - Available web server routes: 
/conversations/<conversation_id>/messages POST add_message
/conversations/<conversation_id>/tracker/events POST append_events
/webhooks/rasa GET custom_webhook_RasaChatInput.health
/webhooks/rasa/webhook POST custom_webhook_RasaChatInput.receive
/webhooks/rest GET custom_webhook_RestInput.health
/webhooks/rest/webhook POST custom_webhook_RestInput.receive
/model/test/intents POST evaluate_intents
/model/test/stories POST evaluate_stories
/conversations/<conversation_id>/execute POST execute_action
/webhooks/facebook GET fb_webhook.health
/webhooks/facebook/webhook GET fb_webhook.token_verification
/webhooks/facebook/webhook POST fb_webhook.webhook
/domain GET get_domain
/socket.io POST handle_request
/ GET hello
/model PUT load_model
/model/parse POST parse
/conversations/<conversation_id>/predict POST predict
/conversations/<conversation_id>/tracker/events PUT replace_events
/conversations/<conversation_id>/story GET retrieve_story
/conversations/<conversation_id>/tracker GET retrieve_tracker
/webhooks/socketio GET socketio_webhook.health
/status GET status
/model/predict POST tracker_predict
/model/train POST train
/model DELETE unload_model
/version GET version
2019-08-19 10:50:06 INFO root - Starting Rasa server on http://localhost:5005
2019-08-19 10:50:06 INFO root - Enabling coroutine debugging. Loop id 140693200207896.
2019-08-19 10:50:06 DEBUG rasa.model - Extracted model to '/var/folders/wk/ynmgx56s43xcfzq2cc3_nmw40000gn/T/tmpdxi6qxa5'.
2019-08-19 10:50:48 INFO rasa.nlu.components - Added 'SpacyNLP' to component cache. Key 'SpacyNLP-en'.
2019-08-19 10:50:48 DEBUG rasa.core.tracker_store - Connected to InMemoryTrackerStore.
2019-08-19 10:50:48 DEBUG rasa.model - Extracted model to '/var/folders/wk/ynmgx56s43xcfzq2cc3_nmw40000gn/T/tmpts0_pyp1'.
2019-08-19 10:50:49 DEBUG pykwalify.compat - Using yaml library: /Users/michael/Documents/projects/rasa2/env/lib/python3.6/site-packages/ruamel/yaml/ __init__.py
2019-08-19 10:51:08 ERROR asyncio - exception in Task. __repr__
handle: <Handle <TaskStepMethWrapper object at 0x14036fdd8> created at /usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/tasks.py:519>
task: Exception in __repr__ AttributeError("'NoneType' object has no attribute 'co_filename'",); value type: <class '_asyncio.Task'>
Traceback (most recent call last):
  File "uvloop/cbhandles.pyx", line 121, in uvloop.loop.Handle._format_handle
  File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_tasks.py", line 15, in _task_repr_info
    coro = coroutines._format_coroutine(task._coro)
  File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/coroutines.py", line 323, in _format_coroutine
    filename = coro_code.co_filename
AttributeError: 'NoneType' object has no attribute 'co_filename'
```

---

<div class="post-metadata">

**Author:** ![fede](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/fede/32/7095_2.png) [@fede](https://forum.rasa.com/u/fede)\
**Post date:** [August 20, 2019, 12:57pm UTC](https://forum.rasa.com/t/running-rasa-in-pycharm-debugger/14438/4 "2019-08-20T12:57:12Z")

</div>

Glad you were able to solve the directory problem. So now it runs, but you can’t actually use it, correct?

---

<div class="post-metadata">

**Author:** ![Charlesjwilliams2](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/charlesjwilliams2/32/5238_2.png) [@Charlesjwilliams2](https://forum.rasa.com/u/Charlesjwilliams2)\
**Post date:** [October 18, 2019, 4:08pm UTC](https://forum.rasa.com/t/running-rasa-in-pycharm-debugger/14438/5 "2019-10-18T16:08:54Z")

</div>

I found that the biggest ‘gotcha’ was setting the interpreter to use. Assuming you’ve created an environment to run rasa in and you’ve downloaded the code, when you open the rasa project you must set the Python interpreter in settings to something as below:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/3/3795460aaea994c1ed1c5ebf6dfa453c2cf552b6.png)

As you can see I used conda and setup a rasa environment. All the dependencies needed to run rasa have been loaded into it. this was confirmed by being able to `rasa run` from the installed directory.

---

<div class="post-metadata">

**Author:** ![lohith.arcot](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@lohith.arcot](https://forum.rasa.com/u/lohith.arcot)\
**Post date:** [November 25, 2019, 9:08am UTC](https://forum.rasa.com/t/running-rasa-in-pycharm-debugger/14438/6 "2019-11-25T09:08:27Z")

</div>

Here is a screenshot of Pycharm configuration to debug.

> [@Running Rasa within an IDE for debugging purposes](http://forum.rasa.com/t/running-rasa-within-an-ide-for-debugging-purposes/13557/8):
>
> This is how I run server via pycharm. This also will work for debug mode.

let me know if you face problem configuring it.

---

<div class="post-metadata">

**Author:** ![harishruparel](https://avatars.discourse-cdn.com/v4/letter/h/bcef8e/32.png) [@harishruparel](https://forum.rasa.com/u/harishruparel)\
**Post date:** [December 3, 2019, 1:22pm UTC](https://forum.rasa.com/t/running-rasa-in-pycharm-debugger/14438/7 "2019-12-03T13:22:03Z")

</div>

[mmm3bbb](http://forum.rasa.com/u/mmm3bbb)[Michael Bell](http://forum.rasa.com/u/mmm3bbb):

Hi I am pretty new to Rasa and Pycharm. Can you please help me learn how to set the debugger environments in Pycharm.

---

<div class="post-metadata">

**Author:** ![lohith.arcot](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@lohith.arcot](https://forum.rasa.com/u/lohith.arcot)\
**Post date:** [December 5, 2019, 2:28am UTC](https://forum.rasa.com/t/running-rasa-in-pycharm-debugger/14438/8 "2019-12-05T02:28:50Z")

</div>

I have added a screenshot in the above link. Could you please follow it and let me know where you are stuck?

---

<div class="post-metadata">

**Author:** ![harishruparel](https://avatars.discourse-cdn.com/v4/letter/h/bcef8e/32.png) [@harishruparel](https://forum.rasa.com/u/harishruparel)\
**Post date:** [December 12, 2019, 5:54am UTC](https://forum.rasa.com/t/running-rasa-in-pycharm-debugger/14438/9 "2019-12-12T05:54:17Z")

</div>

thank you Lohith, Followed the same. But still no success, any way we can have a PM. I can share my screen, for you to have a quick look, if you can help me. Will be interested to learn from you.

---

<div class="post-metadata">

**Author:** ![danielenricocahall](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/danielenricocahall/32/15764_2.png) [@danielenricocahall](https://forum.rasa.com/u/danielenricocahall)\
**Post date:** [July 14, 2021, 2:01am UTC](https://forum.rasa.com/t/running-rasa-in-pycharm-debugger/14438/10 "2021-07-14T02:01:59Z")

</div>

I have actually written an article around running/debugging Rasa in PyCharm - here is the link in case this helps anyone looking: [Running and Debugging Rasa Applications in an IDE | by Daniel Cahall | Jul, 2021 | Medium](https://danielcahall.medium.com/running-and-debugging-rasa-applications-in-the-ide-c96f3cd4637d)

---

<div class="post-metadata">

**Author:** ![lohith.arcot](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@lohith.arcot](https://forum.rasa.com/u/lohith.arcot)\
**Post date:** [April 12, 2023, 7:33am UTC](https://forum.rasa.com/t/running-rasa-in-pycharm-debugger/14438/11 "2023-04-12T07:33:52Z")

</div>

![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/4/c/4c8f1a4b6ec507e0e9ba3f61a7e1788479aaba88.png)

This is how the rasa action server is configured

---

<div class="post-metadata">

**Author:** ![Aws\_khadour](https://avatars.discourse-cdn.com/v4/letter/a/f4b2a3/32.png) [@Aws\_khadour](https://forum.rasa.com/u/Aws_khadour)\
**Post date:** [April 16, 2024, 3:13pm UTC](https://forum.rasa.com/t/running-rasa-in-pycharm-debugger/14438/12 "2024-04-16T15:13:51Z")

</div>

i am getting this error: prompt\_toolkit.output.win32.NoConsoleScreenBufferError: No Windows console found. Are you running cmd.exe?
