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

Ecstasy
  • 1,866
  • 1
  • 9
  • 17