I am creating a docker containing python and php. I am writing a python script to connect to a MQTT broker residing in another docker.
In my dockerfile I ensure that I install the paho client by using the following commands:
RUN apt-get install -y python3-dev
RUN apt-get install -y libffi-dev
RUN apt-get install -y libssl-dev
ADD https://bootstrap.pypa.io/get-pip.py /tmp/get-pip.py
RUN cat /tmp/get-pip.py | python3
RUN pip install paho-mqtt
RUN pip install python-etcd
However when I run the python script I get the following error:
ImportError: No module named paho.mqtt.client
The docker installation does not show any error with regards to paho-mqtt installation. It will be great if someone can guide on this.
paho-mqtt
? Can you findpaho mqtt
in youpip list
? – Ducksmqtt
is not being installed properly. Could you verify it from thepip list
command? What do you get when you run thepython --version
command? I can install and import it with no problem in Python 3.6. – Ducks