including smartsheet sdk in a bundled app via pyinstaller

流过昼夜 提交于 2020-04-21 19:47:42

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!