Azure / azure-iot-sdk-python

A Python SDK for connecting devices to Microsoft Azure IoT services
MIT License
417 stars 374 forks source link

ImportError: cannot import name 'ProvisioningSession' from 'azure.iot.device' #1153

Closed gautamsabba closed 10 months ago

gautamsabba commented 10 months ago

3.0.0b2 seems to be missing classes.

Context

Description of the issue

Looks like ProvisioningSession is missing from the pip module.

See dir listing below

Directory of C:\Python10\Lib\site-packages\azure\iot\device

25-08-2023 04.32 PM

. 25-08-2023 04.32 PM .. 25-08-2023 04.32 PM 6,937 config.py 25-08-2023 04.32 PM 3,904 connection_string.py 25-08-2023 04.32 PM 944 constant.py 25-08-2023 04.32 PM 1,458 custom_typing.py 25-08-2023 04.32 PM 6,659 edge_hsm.py 25-08-2023 04.32 PM 1,948 http_path_iothub.py 25-08-2023 04.32 PM 12,573 iothub_http_client.py 25-08-2023 04.32 PM 31,367 iothub_mqtt_client.py 25-08-2023 04.32 PM 20,351 iothub_session.py 25-08-2023 04.32 PM 818 iot_exceptions.py 25-08-2023 04.32 PM 8,949 models.py 25-08-2023 04.32 PM 41,408 mqtt_client.py 25-08-2023 04.32 PM 10,800 mqtt_topic_iothub.py 25-08-2023 04.32 PM 4,560 mqtt_topic_provisioning.py 25-08-2023 04.32 PM 2,141 request_response.py 25-08-2023 04.32 PM 11,271 sastoken.py 25-08-2023 04.32 PM 2,746 signing_mechanism.py 25-08-2023 04.32 PM 1,403 user_agent.py 25-08-2023 04.32 PM 557 init.py 25-08-2023 04.32 PM pycache 19 File(s) 170,794 bytes 3 Dir(s) 287,644,717,056 bytes free

C:\Python10\Lib\site-packages\azure\iot\device>

Code sample exhibiting the issue

from azure.iot.device import ( ProvisioningSession, MQTTConnectionDroppedError, MQTTConnectionFailedError
)

Console log of the issue

File "G:\Other computers\E8\Venture\Halo IT\Customers\MiiCare\Development\code\provisioning_symmetric_key.py", line 3, in from azure.iot.device import ( ImportError: cannot import name 'ProvisioningSession' from 'azure.iot.device' (C:\Python10\lib\site-packages\azure\iot\device__init__.py)

cartertinney commented 10 months ago

We apologize for the confusion regarding communication around version 3.0.0b2. The status of this release is in question, and we have since reverted the main repository back to version 2.x. At this time we do not recommend the use of version 3.x

My apologies for the inconvenience.