My Rasa X instance is connected with my git repo, everything works fine, except actions.
When my actions.py doesn’t contain the “import requests” line, my actions are running fine, but when I add import requests, there is a ModuleNotFound Exception. Apparently, the requests package is missing from the rasa image.
To resolve this, I tried building my own rasa image while adding the requests package like suggested in the docs: Deploying your Rasa Assistant.
This is my Dockerfile:
# Extend the official Rasa SDK image
FROM rasa/rasa-sdk:latest
# Add a custom python library (e.g. jupyter)
RUN pip --no-cache-dir install requests
This is the output:
Sending build context to Docker daemon 35.23MB
Step 1/2 : FROM rasa/rasa-sdk:latest
---> 1a54ed66135a
Step 2/2 : RUN pip --no-cache-dir install requests
---> Running in 980d6da2c146
Collecting requests
Downloading requests-2.23.0-py2.py3-none-any.whl (58 kB)
Requirement already satisfied: certifi>=2017.4.17 in /opt/venv/lib/python3.6/site-packages (from requests) (2019.11.28)
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
Downloading urllib3-1.25.8-py2.py3-none-any.whl (125 kB)
Requirement already satisfied: idna<3,>=2.5 in /opt/venv/lib/python3.6/site-packages (from requests) (2.8)
Requirement already satisfied: chardet<4,>=3.0.2 in /opt/venv/lib/python3.6/site-packages (from requests) (3.0.4)
Installing collected packages: urllib3, requests
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/opt/venv/lib/python3.6/site-packages/urllib3'
Consider using the `--user` option or check the permissions.
The command '/bin/bash -o pipefail -c pip --no-cache-dir install requests' returned a non-zero code: 1