Closed zackbcom closed 4 years ago
Found that I needed to add it to the Virtualenv. If anyone comes across this post here is how to add it to the docker.
Dockerfile
WORKDIR /usr/share/rhasspy
RUN apt-get update && \
apt-get install -y build-essential
RUN /usr/share/rhasspy/.venv/bin/pip install RPi.GPIO
ENTRYPOINT ["/run.sh"]
Docker-compose:
services:
rhasspy:
container_name: rhasspy
build: ./dockerfiles/rhasspy
restart: always
volumes:
- "$HOME/.config/rhasspy/profiles:/profiles"
ports:
- "12101:12101"
devices:
- "/dev/snd:/dev/snd"
- "/dev/gpiomem:/dev/gpiomem"
command: --user-profiles /profiles --profile en
I'm currently running the docker image on a Raspberry Pi 3. I've installed the RPI.GPIO module with the command
apt install python3-rpi.gpio
and made the containerprivileged
to have access to the GPIO Pins.Once I try to import the RPi Module into the Custom script for Intent Handling I'm receiving this error in the console:
Running the command
python3 /profiles/en/command.py < testing_json_payload.json
inside the running docker works just fine using the imported RPi Module.Once I try using it in the custom script it doesn't see the module.
Is there a specific way to install the needed modules to be available in the sub-process?
Custom Script: https://hastebin.com/edejubejid.py
Version: 2.4.20