I have created the following Python script using the gspread and oauth2 modules
import gspread
from oauth2client.client import SignedJwtAssertionCredentials
credentials = SignedJwtAssertionCredentials("client_email","private_key", "https://spreadsheets.google.com/feeds")
gc = gspread.authorize(credentials)
spreadsheet = gc.open_by_key("spreadsheet_id")
worksheet = spreadsheet.worksheet("sheet_name")
lstoforders = worksheet.get_all_values()
...some extra code...
When I run this code as a .py file everything works smoothly. However, when I try to package it into an executable Windows program using py2exe, I get the following output
The following modules appear to be missing
['ElementC14N', 'IronPythonConsole', 'System', 'System.Windows.Forms.Clipboard', '_scproxy', 'ca_certs_locater', 'clr', 'console', 'email.FeedParser', 'email.Message', 'email.Utils', 'google.appengine.api', 'google.appengine.api.urlfetch','google3.apphosting.api', 'google3.apphosting.api.urlfetch', 'http', 'modes.editingmodes', 'oauth2client.client' 'pyreadline.keysyms.make_KeyPress', 'pyreadline.keysyms.make_KeyPress_from_keydescr', 'pyreadline.keysyms.make_keyinfo', 'pyreadline.keysyms.make_keysym', 'startup', 'urllib.parse']
Accordingly, when I try to run the resulting exe file, I get the following error
Traceback (most recent call last):
File "gspread_to_autocomplete_json.py", line 2, in <module> ImportError: No module named oauth2client.client
It appears as if py2exe cannot find the gspread and oauth2client.client modules. These modules are installed on my machine.
Does anybody have a clue why this is happening?
Thanks.
Nicola