Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
900 views
in Technique[技术] by (71.8m points)

python - Module Not Found Error in Rasa Custom Action Server using DOCKER

I am new to Rasa and Docker. I am trying to build a chatbot using Rasa. I have included some custom actions in action.py file.

It works fine in my local, but on deploying in cloud (GCP), the custom actions don't get executed. I am using Docker to run the action server.

docker-compose.override.yml

version: "3.4"
services:
  rasa-production:
    volumes:
      - './custom_connectors:/app/custom_connectors'
  rasa-worker:
    volumes:
      - './custom_connectors:/app/custom_connectors'
  app:
    image: 'rasa/rasa-sdk:latest'
    volumes:
      - './actions:/app/actions'
    expose:
      - '5055'
    depends_on:
      - rasa-production

I am running the services using docker command

docker-compose up -d 

on checking the status of the docker containers, I see that the custom action server, keeps restarting. On checking the logs I get the below error:

021-01-25 07:52:32 INFO     rasa_sdk.endpoint  - Starting action endpoint server...
2021-01-25 07:52:32 ERROR    rasa_sdk.executor  - Failed to register package 'actions'.
Traceback (most recent call last):
  File "/app/rasa_sdk/executor.py", line 254, in register_package
    self._import_submodules(package)
  File "/app/rasa_sdk/executor.py", line 217, in _import_submodules
    self._import_module(full_name)
  File "/app/rasa_sdk/executor.py", line 231, in _import_module
    module = importlib.import_module(name)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/app/actions/actions.py", line 14, in <module>
    from rasa_sdk.types import DomainDict
  File "/app/rasa_sdk/types.py", line 3, in <module>
    from typing_extensions import TypedDict
ModuleNotFoundError: No module named 'typing_extensions'

I see that the typing_extensions module is installed in the python lib path.

Any help is appreciated.

question from:https://stackoverflow.com/questions/65880846/module-not-found-error-in-rasa-custom-action-server-using-docker

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I resolved the same issue by adding dependency 'typing_extensions'


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...