Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.64k stars 2.84k forks source link

Exception has occurred: ModuleNotFoundError No module named 'azure.servicebus' #26716

Closed charlie2clarke closed 2 years ago

charlie2clarke commented 2 years ago

Describe the bug Unable to import ServiceBusClient from azure-servicebus.

To Reproduce Steps to reproduce the behavior:

  1. pip install azure-servicebus
  2. from azure.servicebus import ServiceBusClient

My requirements.txt following a pip freeze:

azure-common==1.1.28
azure-core==1.26.0
azure-nspkg==3.0.2
azure-servicebus==7.8.0
black==22.8.0
certifi==2022.9.24
charset-normalizer==2.1.1
click==8.1.3
idna==3.4
importlib-metadata==5.0.0
isodate==0.6.1
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.1
msrest==0.7.1
mypy-extensions==0.4.3
numpy==1.23.3
oauthlib==3.2.1
pathspec==0.10.1
platformdirs==2.5.2
python-dateutil==2.8.2
pytz==2022.4
requests==2.28.1
requests-oauthlib==1.3.1
six==1.16.0
tomli==2.0.1
typing-extensions==4.3.0
uamqp==1.6.0
urllib3==1.26.12
Werkzeug==2.2.2
zipp==3.8.1

Output of pip show azure-servicebus:

Name: azure-servicebus
Version: 7.8.0
Summary: Microsoft Azure Service Bus Client Library for Python
Home-page: https://github.com/Azure/azure-sdk-for-python
Author: Microsoft Corporation
Author-email: azpysdkhelp@microsoft.com
License: MIT License
Location: /home/neo/neo-betalab/uni/event-receiver/venv/lib/python3.8/site-packages
Requires: six, azure-core, isodate, msrest, uamqp, typing-extensions, azure-common
Required-by: 

Is this a version compatibility issue?

charlie2clarke commented 2 years ago

Apologies, you can consider this issue closed.

My problem was that I had a local module named azure and this was causing conflict issues when trying to import azure.servicebus. I've renamed my personal azure module and everything is working fine now.

kashifkhan commented 2 years ago

@charlie2clarke glad that you were able to resolve the issue :)