[英]How do I execute spark submit job with python3/python2 mypthon3.zip compiled zip on databricks DRE 7.6 and above?
我正在尝试在 Databricks DRE 7.6 及更高版本上使用 python3 和 python2 编译 mypthon3.zip 执行 spark 提交作业并得到以下错误
Traceback (most recent call last):
File "/dbfs/tmp/WT_SPARK3/Inputsql.py", line 1, in <module>
from com.test.mymodule import Mymodule
zipimport.ZipImportError: can't find module 'com'
mypython3.zip : 用 python3 编译并包含带有 pycache 文件夹的 pyc 文件
编译命令:python3 -m compileall -b package_dir
mypython3.zip
|- com
|- __pycache__ (empty folder)
|- __init__.pyc
|- test
|- __pycache__ (empty folder)
|- __init__.pyc
|- mymodule.pyc
输入sql.py
from com.test.mymodule import Mymodule
import sys
import time
import logging
火花提交命令
["--py-files","/dbfs/tmp/mypthon3.zip","/dbfs/tmp/Inputsql.py"]
请让我知道如何修复它
谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.