Stale package on arm64?
mathaou opened this issue · 4 comments
Based on the following information:
https://learn.microsoft.com/en-us/azure/iot-hub/device-management-python
https://github.com/Azure/azure-iot-sdk-python/blob/main/samples/iothub_simple_c2d_with_reconnect.py
cannot import name 'IoTHubDeviceClient' from 'azure.iot.device'
cannot import name 'MQTTConnectionDroppedError' from 'azure.iot.device'
This is on arm64 python3. Is this package stale or has this functionality been removed from the SDK? There appears to be conflicting information from both Microsoft itself and the wider community wherever I go regarding the state of this python SDK.
If I really have to I will just use the Node.js/Java SDK since those appear to be the most widely supported, but I'm just confused as to what is even going on with this developer ecosystem.
What version of the SDK are you using?
There are a few things that come to mind here. Have you checked that you ran pip install azure-iot-device==3.0.0b2
on whichever python version you're running? And that the python version is 3.7 or newer? Also, I'm assuming you got those error messages when running the linked simple_c2d_with_reconnect sample? If so, it might help if you post the logs, but most important would be the SDK version.
3.0.0b2 with Python v 3.9.2
https://github.com/Azure/azure-iot-sdk-python/blob/main/samples/provisioning_symmetric_key.py
This example also give me a 'cannot import name 'ProvisioningSession'' error
As for logs, my messages about error messages are the logs so far. I have a fleet of devices that I want to provision themselves automatically - as in every device gets the same disk image and there's no inputting of connection strings or other information required during manufacturing. Provisioning seems to be the way to go, so we would like to be able to use that functionality on arm64.
I see that the code in the repo would perform all of these examples as expected - so this leads me to believe that this is just stale code in the arm64 repo.
Right now, version 3.x of our SDK is not yet fully featured - it is still just in a preview. 3.0.0b2 that you have installed does not yet have ProvisioningSession
included in it. Do note that until we exit preview, APIs, object models, and design approaches are completely subject to change as they are all a work in progress. We do not have a date for a finished 3.x release right now.
All of this means that we suggest you stick with SDK 2.x for most purposes, as it is fully featured, and will provide the full functionality you are looking for, using the IoTHubDeviceClient
, IoTHubModuleClient
and ProvisioningDeviceClient
. The latest version of the SDK is 2.12.0 and is very stable. It is compatible with Python 3.7+, including your version of Python.
You can find samples for SDK version 2.x in the v2 branch
We apologize for the confusion as we go through this transition in major versions.
Please confirm if using version 2.12 addresses your issue
This solved the issue.