简体   繁体   English

无法将我的模拟设备连接到Azure IoT中心以使用Python发送数据

[英]Failing to connect my simulated device to azure IoT hub to send the data using Python

Can anybody please tell me why am I getting this error: 有人可以告诉我为什么会出现这个错误:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-16-215347aec7aa> in <module>()
     11 from iothub_client import IoTHubClient, IoTHubClientError, IoTHubTransportProvider, IoTHubClientResult
     12 from iothub_client import IoTHubMessage, IoTHubMessageDispositionResult, IoTHubError, DeviceMethodReturnValue
---> 13 from iothub_client_args import get_iothub_opt, OptionError
     14 
     15 # HTTP options

ModuleNotFoundError: No module named 'iothub_client_args'

When I tried to run this python script 当我尝试运行此python脚本时

I have registered my device and replaced the connection string also, I have installed 1)azure-iothub-service-client and 2)azure-iothub-device-client packages 我已经注册了设备并替换了连接字符串,我已经安装了1)azure-iothub-service-client和2)azure-iothub-device-client软件包

Am I missing any packages? 我是否缺少任何包裹?

Based on your error information, it looks like you lose iothub_client_args.py sample file. 根据您的错误信息,您似乎丢失了iothub_client_args.py示例文件。

You can download this file iothub_client_args.py and put it in the same folder with the sample file you were running. 您可以下载此文件iothub_client_args.py并将其与正在运行的示例文件放在同一文件夹中。

If you have cloned the SDK repository, navigate to the folder device/samples and put the file there. 如果您已克隆SDK储存库,请导航至设备/样本文件夹,然后将文件放在此处。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM