How to pass actions path when running actions server

Hi there,

I’m wondering how can I pass the path to the actions folder to the rasa run actions command. The actions folder and all rasa resources are in folder front_end

I tried running rasa run actions --actions front_end/actions

Also I tried running rasa run actions --actions .\front_end\actions

Which gives me following error:

PS C:\Users\ftb16173\Documents\Chatbot> rasa run actions --actions .\front_end\actions
c:\users\ftb16173\appdata\local\programs\python\python38\lib\site-packages\sanic_cors\extension.py:39: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  SANIC_VERSION = LooseVersion(sanic_version)
2022-09-13 18:52:39 INFO     rasa_sdk.endpoint  - Starting action endpoint server...
Traceback (most recent call last):
  File "c:\users\ftb16173\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\ftb16173\appdata\local\programs\python\python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\ftb16173\AppData\Local\Programs\Python\Python38\Scripts\rasa.exe\__main__.py", line 7, in <module>
  File "c:\users\ftb16173\appdata\local\programs\python\python38\lib\site-packages\rasa\__main__.py", line 110, in main
    cmdline_arguments.func(cmdline_arguments)
  File "c:\users\ftb16173\appdata\local\programs\python\python38\lib\site-packages\rasa\cli\run.py", line 59, in run_actions
    sdk.main_from_args(args)
  File "c:\users\ftb16173\appdata\local\programs\python\python38\lib\site-packages\rasa_sdk\__main__.py", line 18, in main_from_args
    run(
  File "c:\users\ftb16173\appdata\local\programs\python\python38\lib\site-packages\rasa_sdk\endpoint.py", line 139, in run
    app = create_app(
  File "c:\users\ftb16173\appdata\local\programs\python\python38\lib\site-packages\rasa_sdk\endpoint.py", line 82, in create_app
    executor.register_package(action_package_name)
  File "c:\users\ftb16173\appdata\local\programs\python\python38\lib\site-packages\rasa_sdk\executor.py", line 262, in register_package
    self._import_submodules(package)
  File "c:\users\ftb16173\appdata\local\programs\python\python38\lib\site-packages\rasa_sdk\executor.py", line 218, in _import_submodules
    package = self._import_module(package)
  File "c:\users\ftb16173\appdata\local\programs\python\python38\lib\site-packages\rasa_sdk\executor.py", line 239, in _import_module
    module = importlib.import_module(name)
  File "c:\users\ftb16173\appdata\local\programs\python\python38\lib\importlib\__init__.py", line 122, in import_module
    raise TypeError(msg.format(name))
TypeError: the 'package' argument is required to perform a relative import for '.\\front_end\\actions'

How can I solve this? Thanks.

I assume this is your file structure

Chatbot/
├── front_end/
    ├── actions/
        ├──__init__.py
        └── actions.py
        └── ...

You can run,

rasa run actions --actions front_end.actions

Hope this helps solve your problem.