You can use a better alternative!
pyinstaller is not safe. in the directory where pyinstaller produces the executable file, you can find some files in .pyc format. a code thief can easily decompile those files to get your main source code in python. this is because python is an interpreted language (unlike c or c++ which are compiled languages). pyinstaller provides a --key option to remedy this, but again this is not at all safe!
by searching this topic online, one of the safe ways to produce an executable file is via transforming your python code to c code via cython, and then produce an executable file from the generated c file of your code. also, bydoing this, your code would run faster (you will get the performance of a code written in c). I tested this method for deepstream-test2 and it worked perfectly. here are the instructions:
1- install cython:
pip install Cython
2- change the name of your deepstream-test2.py file to deepstream-test2.pyx (this is only a name change, your code remains the same)
3-automatically generate a deepstream-test2.c (in c language) file from your deepstream-test2.pyx (in python language) code by opening up a terminal and running:
cython deepstream-test2.pyx --embed
4- run the following code to generate a deepstream-test2 executable file from the deepstream-test2.c file (which was generated in the previous step):
gcc -Os -I /usr/include/python3.6m -o deepstream-test2 deepstream-test2.c -L/usr/lib/aarch64-linux-gnu -lpython3.6m -lpthread -lm -lutil -ldl
5- run your executable file:
your executable is now safe! for a thief, decompiling the executable that we just generated, would be a really difficult task.