I built a python module and I want to import it in my pyspark application.
My package directory structure is:
wesam/
|-- data.py
`-- __init__.py
A simple import wesam
at the top of my pyspark script leads to ImportError: No module named wesam
. I also tried to zip it and ship it with my code with --py-files
as recommended in this answer, with no luck.
./bin/spark-submit --py-files wesam.zip mycode.py
I also added the file programmatically as suggested by this answer, but I got the same ImportError: No module named wesam
error.
.sc.addPyFile("wesam.zip")
What am I missing here?