简体   繁体   English

Python azure sdk - 发生异常:ModuleNotFoundError 没有名为“azure.servicebus”的模块

[英]Python azure sdk - Exception has occurred: ModuleNotFoundError No module named 'azure.servicebus'

  • Package: azure-servicebus : Package:蔚蓝服务总线
  • Package version: 7.8.0 : Package 版本:7.8.0
  • OS: WSL 2 :操作系统:WSL 2
  • Python version: 3.8.10 : Python 版本:3.8.10

Describe the bug Unable to import ServiceBusClient from azure-servicebus.描述 Unable to import ServiceBusClient from azure-servicebus 的错误

To Reproduce Steps to reproduce the behavior:重现重现行为的步骤:

  1. pip install azure-servicebus pip 安装 azure-servicebus
  2. from azure.servicebus import ServiceBusClient从 azure.servicebus 导入 ServiceBusClient

My requirements.txt following a pip freeze: pip 冻结后我的 requirements.txt:

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: pip 的 Output 显示 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?这是版本兼容性问题吗?

In case anyone happens to be as naive as me:万一有人碰巧像我一样天真:

I had a local module named azure and this was causing conflict issues when trying to import azure.servicebus.我有一个名为 azure 的本地模块,这在尝试导入 azure.servicebus 时导致了冲突问题。 I've renamed my personal azure module and everything is working fine now.我已经重命名了我的个人 azure 模块,现在一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Python 中导入 azure.servicebus 错误 - Import azure.servicebus error in Python Python中的azure.servicebus消息ValueError - azure.servicebus Message ValueError in Python 发生异常:ModuleNotFoundError没有名为'requests'的模块 - Exception has occurred: ModuleNotFoundError No module named 'requests' 发生异常:ModuleNotFoundError 没有名为“pygame”的模块 - Exception has occurred: ModuleNotFoundError No module named 'pygame' 发生异常:ModuleNotFoundError No module named - Exception has occurred: ModuleNotFoundError No module named ModuleNotFoundError:没有名为“azure”的模块 - ModuleNotFoundError: No module named 'azure' ModuleNotFoundError:没有名为“azure”的模块 - ModuleNotFoundError: No module named 'azure' Python ModuleNotFoundError:没有名为“azure.cognitiveservices”的模块 - Python ModuleNotFoundError: No module named 'azure.cognitiveservices' 发生异常:ModuleNotFoundError No module named 'win32api' - Exception has occurred: ModuleNotFoundError No module named 'win32api' ImportError:无法从“azure.servicebus”导入名称“ServiceBusClient” - ImportError: cannot import name 'ServiceBusClient' from 'azure.servicebus'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM