问题
I developed a Python 2.7 app using the smartsheet SDK and it works fine on y machine. Then I bundle it into an app via PyInstaller and I get this error when I run it:
DEBUG:smartsheet.smartsheet:try loading api class Home
DEBUG:smartsheet.smartsheet:try loading model class Home
DEBUG:smartsheet.smartsheet:ImportError! Cound not load api or model
class Home Exception in Tkinter callback Traceback (most recent call
last): File "lib-tk/Tkinter.py", line 1536, in __call__ File
"pacers.py", line 166, in log_processing File "pacers.py", line 57,
in new_sheet AttributeError: 'str' object has no attribute
'create_sheet'
EDIT 1:
It's this AttributeError that I can't get my head around. I'm able to create other smartsheet objects before this with no problem. And running the source code doesn't present a problem. Any ideas?
It works from source just fine! -->
DEBUG:smartsheet.smartsheet:try loading api class Home
DEBUG:smartsheet.smartsheet:loaded instance of api class Home
DEBUG:smartsheet.models.column:deleting index from obj (filter: create_sheet)
DEBUG:smartsheet.models.column:deleting locked from obj (filter: create_sheet)
Edit 2:
Turns out PyInstaller wasn't importing all of the module properly, had to explicitly import objects, e.g. smartsheet.Home
来源:https://stackoverflow.com/questions/39001131/including-smartsheet-sdk-in-a-bundled-app-via-pyinstaller