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

441 Views Asked by At

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

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

Am I missing any packages?

1

There are 1 best solutions below

0
On

Based on your error information, it looks like you lose iothub_client_args.py sample file.

You can download this file iothub_client_args.py and put it in the same folder with the sample file you were running.

If you have cloned the SDK repository, navigate to the folder device/samples and put the file there.