So I have a GUI.py file with functionality mapped to a button that when clicked, uploads files stored in a particular folder to google drive. The script works fine when I run it using vscode, but it won't work when using the same in the executable file. I am using pyinstaller to package the python file into an executable file. I am using the following command to package the script:
pyinstaller GUI.py --noconfirm --onedir --windowed --add-data "G:\Projects\ProjectA\venv\Lib\site-packages/customtkinter;customtkinter/" --add-data "G:\Projects\ProjectA\venv\Lib\site-packages/pydrive;pydrive/"
I tried the following:
- --add-data "G:\Projects\ProjectA\venv\Lib\site-packages/pydrive;pydrive/" I added this statement to the command(didn't work)
- I tried adding two json files(client_secrets and credentials) to the .spec file.