I am trying to download the Pika package using Pip3 inside of a Dockerfile/container. My current Dockerfile looks like this:
FROM rabbitmq
#install Python
RUN apt-get update &&\
apt-get install -y \
python3-pip
#Create new user
RUN useradd -ms /bin/bash user
USER user
WORKDIR /home/user
#Install Pika
RUN pip3 install pika
RUN mkdir videos
COPY . .
CMD ["python3", "ffmpeg.py"]
The output I get claims that it all works and everything is installed successfully. However the container exits immediately due to the error:
Traceback (most recent call last):
File "ffmpeg.py", line 1, in <module>
import pika, sys, os
ModuleNotFoundError: No module named 'pika'
If I SSH into the container and download Pika manually using:
pip3 install pika
And then run the python file, everything works. But for some reason the Dockerfile can't install it with the exact same command.
So far I've tried pretty much every solution on this page
I'm running Ubuntu version 20.04.1 and Docker version 20.10.2.
Anything else I can try?