[英]Executing python code present on azure storage using databricks cluster
We are having code structure like我们有这样的代码结构
In pkg folder we have main.py and execute.py imports (from pkg import main.hello)在 pkg 文件夹中,我们有 main.py 和 execute.py 导入(来自 pkg import main.hello)
execute.py执行.py
from mnt.cdr.code.pkg import main
main.hello()
main.py主程序
def hello():
print("hello")
this code is present on azure storage and that blob container is mounted to /mnt/cdr/code.. But we are getting "mnt Module not found".此代码存在于 azure 存储中,并且该 blob 容器已安装到 /mnt/cdr/code.. 但我们收到“找不到 mnt 模块”。
How can I run this code from blob container on azure databricks cluster?如何从 azure databricks 集群上的 blob 容器运行此代码?
The Module Not Found Error usually occurs when Python cannot locate an error. Module Not Found Error 通常出现在Python 无法定位错误的时候。 The most common cause of this error is not installing modules required or importing a module incorrectly.
此错误的最常见原因是没有安装所需的模块或错误地导入了模块。
please check if all modules are imported.If all are correct please restart the cluster and check请检查是否导入了所有模块。如果都正确请重启集群并检查
The issue can be due to version of azure library which may conflict with the already present libraries.Check by downgrading or upgrading Azure library.该问题可能是由于 azure 库的版本可能与现有库冲突。通过降级或升级 Azure 库进行检查。 Also When you try to access an already created mount point or create a new mount point, it fails with the error.
此外,当您尝试访问已创建的安装点或创建新的安装点时,它会失败并出现错误。
To unmount a mount point, use the following command: dbutils.fs.unmount("/mnt/")要卸载挂载点,请使用以下命令:dbutils.fs.unmount("/mnt/")
check Failure when mounting Blob storage - Azure Databricks | 安装 Blob 存储时检查失败 - Azure Databricks | Microsoft Docs & bash - Azure Databricks cluster init script - install python wheel - Stack Overflow
Microsoft Docs & bash - Azure Databricks 集群初始化脚本 - 安装 python wheel - 堆栈内存溢出
References:参考:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.