0

After installing azure servicebus from pypl( azure-servicebus 7.3.4 ) using pip, i am trying those provided sample code from https://pypi.org/project/azure-servicebus/.

It gives error: from azure.servicebus import ServiceBusClient ImportError: cannot import name 'ServiceBusClient' from partially initialized module 'azure.servicebus' (most likely due to a circular import) (C:\python\lib\site-packages\azure\servicebus_init_.py)

I am using windows10.

other azure services like FaceAPI and CustomVision libraries are working fine. Just this ServiceBus is throwing error.

I am new to azure in python. Any kind help of help is highly appreciable.

1 Answers1

0

Make sure you don’t have any of your working .py file named like ServiceBusClient.py or ServiceBusMessage.py or azure_servicebus.py which can conflict with Python/ServiceBus package installed files.

If you are using Python 3.8.9, you can try installing the lower version of azure-servicbus as answered by Frank Gong

pip install azure-servicebus==7.0.0

You can refer to ImportError: cannot import name '...' from partially initialized module '...' (most likely due to a circular import), Circular Import Error while importing create_engine in Sqlalchemy, and ImportError: cannot import name 'ServiceBusClient' from 'azure.servicebus'

You can refer to the available Azure Service Bus libraries for Python

DeepDave-MT
  • 1,861
  • 1
  • 5
  • 18
  • 1
    It worked like charm!! Thank you. I installed python3.6 and then azure-servicebus. Its working fine. – coolarshad Nov 12 '21 at 11:47
  • If my answer is helpful for you, you can upvote and accept it as an answer(click on the checkmark beside the answer to toggle it from greyed out to fill in). This can be beneficial to other community members. Thank you! – DeepDave-MT Nov 12 '21 at 11:58