import paho.mqtt. client as mqtt
mqttc = mqtt.Client()
导入client用小写的时候报错让用大写,用大写报错找不到该模块
Traceback (most recent call last):
File "C:\Users\38933\Desktop\订阅消息虚拟数据.py", line 13, in <module>
client = mqtt.client("stu215150331")
AttributeError: module 'paho.mqtt.client' has no attribute 'client'. Did you mean: 'Client'?
================== RESTART: C:\Users\38933\Desktop\订阅消息虚拟数据.py =================
Traceback (most recent call last):
File "C:\Users\38933\Desktop\订阅消息虚拟数据.py", line 2, in <module>
import paho.mqtt.Client as mqtt
ModuleNotFoundError: No module named 'paho.mqtt.Client'