The --py-files flag is for additional dependencies of python files used in your program; you can see here at SparkSubmit.scala , it uses the so-called “primary argument”, which means the first non-flag argument, to determine whether to send jarfile or send python native mode.
This is why you are trying to load your "$ entry_function" as a jar file that does not exist, since it assumes that you are using Python if this primary argument ends with ".py", and otherwise it assumes that you have there is a .jar file.
Instead of using --py-files just make your /home/full/path/to/file/python/my_python_file.py main argument; then you can either pretend to be python to take the "input function" as an argument to the program, or simply call the input function in your main function inside the python file itself.
Alternatively, you can use --py-files , and then create a new main .py file that calls your input function, and then pass that main .py file as the main argument.
source share