Closed Investigamer closed 2 years ago
I also tried switching to the current developer version of pydrive2 and having the same issue :(
EDIT: I discovered the cause of the issue. The built version is unable to locate the discovery file "drive.v2.json", what is the standard practice for having this file included via pyinstaller?
EDIT2: In the Pydrive2 source if I pass static_discovery=False here it fixes the issue:
self.service = build(
"drive", "v2", http=self.http, cache_discovery=False, static_discovery=False
)
Is there a way to modify this setting without changing the pydrive2 source code?
@MrTeferi please take a look here https://github.com/iterative/dvc/issues/5618 - I think it's the same problem.
Here is how it was fixed in that case https://github.com/iterative/dvc/pull/5619
static_discovery=False
I'm not familiar to be honest, in DVC we include drive.v2.json
as far as I know. If you up to this, you can do some research and we can consider changing this option. But we need to know better what does it mean and what are the consequences.
So I took a look at the fix you linked, I toyed around with it a bit and this is the method that worked for me:
hookspath=["projectname/hooks"]
hook-googleapiclient.model.py
"""
Google API Client, Discovery Hook
"""
from PyInstaller.utils.hooks import ( collect_data_files )
datas = collect_data_files("googleapiclient.discovery_cache")
This worked for me, cheers!
I guess it might be time to contribute this to pyinstaller 🙂 We had https://github.com/iterative/dvc/blob/main/scripts/pyinstaller/hooks/hook-googleapiclient.model.py and https://github.com/iterative/dvc/blob/main/scripts/pyinstaller/hooks/hook-pydrive2.py for years and had contributed other hooks, but just not those yet.
For some reason PyDrive2 stopped authenticating in the latest release of my app even though I haven't changed ANYTHING about my PyDrive setup since last release. The weird thing is, authentication works absolutely fine running the app with Python in IDE, but as soon as I build as an exe with Pyinstaller, the exe version throws this error. The only change I can think of is I upgraded from Python 3.8 to 3.10.5. This is the error I'm getting:
This is my yaml config:
This is the authentication setup: