ModuleNotFoundError:突触笔记本上没有名为“azure.mgmt.eventhub”的模块,即使它位于requirements.txt中

问题描述 投票:0回答:1

我们在

requirements.txt
:

中定义了 azure-management 库

azure-mgmt-eventhub==11.0.0

但是当尝试导入库时找不到:

对于其他开发人员来说,这种情况是间歇性的 - 但对于我使用过的集群来说,这种情况是持续存在的。重新启动会话或集群或重新连接轮子(甚至更新的轮子)并没有改变此行为。

这里可能发生了什么?

azure azure-synapse azure-notebooks
1个回答
0
投票

根据适用于 Python 的 Microsoft Azure SDK,您可以使用命令 pip install azure-mgmt-eventhub 安装

Microsoft Azure 事件中心管理客户端库

正如您所提到的,您正在使用 requirements.txt 文件。我尝试过以下方法:

第1步:

我创建了一个 requirements.txt 文件,其中包含

azure-mgmt-eventhub==11.0.0

第2步:

我已将其上传至 Spark 池。

enter image description here

第三步:

接下来,上传后,我尝试了:

from azure.mgmt.eventhub import EventHubManagementClient

结果:

import pkg_resources
for d in pkg_resources.working_set:
     print(d)

enter image description here

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.