擅长:python、mysql、java
<p>这可能是python存在的一个链接问题。如果要通过pip安装库,它可能链接或安装不正确。我建议使用以下方法重新安装mqtt库。。。你知道吗</p>
<pre><code>sudo -H pip3 install system paho-mqtt
</code></pre>
<p>另外,我注意到你的导入是错误的。你写了:<code>import pho.mqtt.client as mqtt</code>。你知道吗</p>
<p>应该是:</p>
<pre><code>import paho.mqtt.client as mqtt
</code></pre>