ModuleNotFoundError:没有名为“paho”的模块;

发布于 2025-01-16 02:21:49 字数 789 浏览 1 评论 0原文

我正在尝试通过 MQTT 协议与我的树莓派和我的 PC Windows 连接。我有一个无法在 PC 上解决的问题 - 我无法导入已安装到程序中的库:

import paho.mqtt.client as mqtt

导致错误

ModuleNotFoundError: No名为“paho”的模块

该主题已在此处发布(​​导入错误:找不到 paho.mqtt.client),但解决方案不起作用为我。

我在 python 文件夹中看到它:

C:\Users\mhucl\AppData\Local\Programs\Python\Python310\Lib\site-packages\paho\mqtt\client

我在 pip 列表中看到它。但程序找不到它。你知道问题可能出在哪里吗?我使用Python版本3.10.3。我也在不同的电脑上尝试过,结果相同。我遵循了 youtube、论坛上的所有解决方案,但什么也没做。非常感谢。

如果有人想查看以下屏幕截图:

https://uschovna.cz/zasilka/WLUWM5TNP7HP7GDG- XKP/UCKZFIZHCI

I am trying to make connection with my raspberry Pi and my PC windows through MQTT protocol. And I have a problem I cant solve on my PC - I can t import library that I have installed to my program:

import paho.mqtt.client as mqtt

Results in the error

ModuleNotFoundError: No module named 'paho'

The topic was already issued here (Import Error: paho.mqtt.client not found), but solution doesnt work for me.

I see it in the python folder:

C:\Users\mhucl\AppData\Local\Programs\Python\Python310\Lib\site-packages\paho\mqtt\client

I see it in the pip list. But the program can t find it. Do you know where could be the problem? I use python version 3.10.3. I tried it on different PC aswell and the same result. I followed all solutions on youtube, forums and nothing. Thank you very much.

Here are screenshots if someone would like to see:

https://uschovna.cz/zasilka/WLUWM5TNP7HP7GDG-XKP/UCKZFIZHCI

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

向地狱狂奔 2025-01-23 02:21:49
pip install paho-mqtt

https://pypi.org/project/paho-mqtt/

我解决了我的错误使用这个命令

pip install paho-mqtt

https://pypi.org/project/paho-mqtt/

I solved my error by using this command

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文