This executable generation is on raspbian linux, on my raspberry-pi:
Install pyinstaller: (I had to try this several times, as I got the error "http.client.RemoteDisconnected: Remote end closed connection without response" but it suddenly worked):
$ pip3 install pyinstaller
In directory with my tiny_test.py file:
$ pyinstaller -F tiny_test.py
Then, in the created dist folder, I tried to run the compiled executable: $ tiny_test
This gave the error:
"tiny_test: tiny_test: cannot execute binary file"