paho.mqtt.python
paho.mqtt.python copied to clipboard
Issue with Python 3.10.2? ModuleNotFoundError: No module named 'paho'?
Issue with Python 3.10.2? ModuleNotFoundError: No module named 'paho'?
I have Python 3.9.2 and 3.10.2 installed. When I run a given script under 3.9 it works, but on 3.10 it fails with the above error.
I installed paho.mqtt module via pip3 install paho-mqtt. Seem like the install was somehow 3.9 specific?
# pip3 install paho-mqtt Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already satisfied: paho-mqtt in /usr/local/lib/python3.9/dist-packages (1.6.1)
No sure if this a side effect of the module installation or how Python 3.10.2 was installed?
This looks like an environment issue on your machine.
I have Python 3.9.2 and 3.10.2 installed.
How? Using virtualenvs?
Just installed 3.10.2 from source, so it defaults to /usr/local/bin. Just started a simple script... to play with it, and I happen to grab one that used mqtt.
Installing a new Python will wipe out any old packages. You likely need to reinstall paho with pip3.
Closing this due to inactivity; if the problem persists please reopen.
facing same issue, when running "pip3 install paho-mqtt"
it says requirement already satisfied. but while running the code it says,
"ModuleNotFoundError: No module named 'paho'"
@Nehal98 you would need to provide significantly more information (python versions, OS, use of virtualenvs etc). Consider opening a new issue (or, for a quicker answer, search for the error on StackOverflow and try asking there if existing questions don't help) as this issue is a couple of years old (which is why I closed it).