PyDrive not getting included in PyInstaller package

272 views
Skip to first unread message

Eddie Espinal

unread,
Mar 27, 2021, 12:24:44 PM3/27/21
to PyInstaller
I have an pyqt5 app that uses the pydrive library to access Google Drive. If I create the pyinstaller executable file, when I run it the app crashes and won't open. If I comment out the logic to include pydrive it works fine.

Is there a way to include the pydrive library with pyinstaller so it can work properly?

I already tried adding the hiddenimports and nothing.  Does anyone have a solution to a similar problem?

P.s. I'm using `fbs freeze` to create the executable file which under the hood it uses PyInstaller.


Thanks in advance for your help!

Sincerely, 

Eddie.

bwoodsend

unread,
Mar 29, 2021, 5:03:22 AM3/29/21
to PyInstaller

There are a bunch of json files inside googleapiclient. If I collect those then everything works for me. I’ve no idea how to tell fbs how to do this so I’ll explain how to do it in raw PyInstaller and hope that you do.

Running PyInstaller should generate a .spec file with the same base name as your Python code. Edit it putting:

from PyInstaller.utils.hooks import collect_data_files

at the top and change the datas=[], option to datas=collect_data_files("googleapiclient"),. The rebuild using pyinstaller [projectname].spec (replacing [projectname] with whatever the spec file is really called).

Brénainn

Abasi Brown

unread,
Mar 29, 2021, 5:04:07 AM3/29/21
to pyins...@googlegroups.com
you need to add pydrive using a hook, or directly as a tree in the .spec file that pyinstaller creates.  I dont know if you can do the second option using fbs freeze or not.


--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/d42c776c-46d8-44c3-9b2a-d9f2d55bb61en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages