ModuleNotFoundError: No module named 'pymongo' - Cannot start actions server

I cannot start the actions server in docker because it says pymongo is not installed.


2020-09-08 15:58:17 INFO rasa_sdk.endpoint - Starting action endpoint server… 2020-09-08 15:58:17 ERROR rasa_sdk.executor - Failed to register package ‘actions.actions’. Traceback (most recent call last): File “/app/rasa_sdk/”, line 208, in register_package self._import_submodules(package) File “/app/rasa_sdk/”, line 192, in _import_submodules package = importlib.import_module(package) File “/usr/local/lib/python3.6/importlib/”, line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File “”, line 994, in _gcd_import File “”, line 971, in _find_and_load File “”, line 955, in _find_and_load_unlocked File “”, line 665, in _load_unlocked File “”, line 678, in exec_module File “”, line 219, in _call_with_frames_removed File “/app/actions/”, line 31, in import pymongo ModuleNotFoundError: No module named ‘pymongo’

Docker file:

Pull SDK image as base image

FROM rasa/rasa_core_sdk:latest

Use subdirectory as working directory


Copy actions requirements

COPY actions/requirements-actions.txt ./ COPY actions/happy_properties_xml.json ./

Change to root user to install dependencies

USER root

RUN pip install --upgrade pip &&
pip install pymongo

Install extra requirements for actions code

RUN pip install -r requirements-actions.txt

Copy actions code to working directory

COPY ./actions /app/actions

Don’t use root user to run code

USER 1001

Start the action server

CMD [“start”, “–actions”, “actions.actions”]

requirements-actions.txt: pymongo