I have created a python zipped executable using behavior similar to https://docs.python.org/3/library/zipapp.html. (More precisely, I created the executable in bazel using the --build_python_zip
command line flag).
This python executable can run fine on my local machine or in a local Jupyter notebook using:
!python ./my_pyzip_file.zip
However, on Colab, when executing a python zip file I’ve uploaded to my mounted Google Drive, I get:
SyntaxError: Non-UTF-8 code starting with 'x80' in file /content/drive/MyDrive/AttributionPipeline.zip on line 3, but no encoding declared; see https://python.org/dev/peps/pep-0263/ for details
My guess is that the python interpreter is not unzipping the file but instead trying to execute the binary zip file directly as if it were a python file.
Is there any workaround?