I need to update slots value after collecting them, so i need to insert data to mongodb. I have installed pymongo but still i am getting error that no module named ‘pymongo’.
pip install pymongo
i get the error shown below
action_server_1 | Traceback (most recent call last):
action_server_1 | File "/app/rasa_sdk/executor.py", line 175, in register_package
action_server_1 | self._import_submodules(package)
action_server_1 | File "/app/rasa_sdk/executor.py", line 169, in _import_submodules
action_server_1 | results[full_name] = importlib.import_module(full_name)
action_server_1 | File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
action_server_1 | return _bootstrap._gcd_import(name[level:], package, level)
action_server_1 | File "<frozen importlib._bootstrap>", line 994, in _gcd_import
action_server_1 | File "<frozen importlib._bootstrap>", line 971, in _find_and_load
action_server_1 | File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
action_server_1 | File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
action_server_1 | File "<frozen importlib._bootstrap_external>", line 678, in exec_module
action_server_1 | File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
action_server_1 | File "/app/actions/personal_info_form.py", line 9, in <module>
action_server_1 | from pymongo import MongoClient
action_server_1 | ModuleNotFoundError: No module named 'pymongo'
You are actually using Docker to run your bot and you are maybe deriving it from the official rasa images. If so, pymongo is not natively part of the environment, the Dockerfile/compose-file creates. If you want to use it, you could, e.g. extend the currently used rasa image with:
FROM rasa/rasa:latest-full
RUN pip install pymongo
ENTRYPOINT ["rasa"]
The background is, that your pip enviroment is started locally, whereas docker creates its own environment in which your local pip/environment is not natively reachable.