【问题标题】:including smartsheet sdk in a bundled app via pyinstaller通过 pyinstaller 在捆绑的应用程序中包含 smartsheet sdk
【发布时间】:2016-08-17 15:49:09
【问题描述】:

我使用 smartsheet SDK 开发了一个 Python 2.7 应用程序,它在你的机器上运行良好。然后我通过 PyInstaller 将它捆绑到一个应用程序中,当我运行它时出现此错误:

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'

编辑 1:

这是我无法理解的 AttributeError。在此之前,我可以毫无问题地创建其他智能表对象。并且运行源代码不会出现问题。有什么想法吗?

它从源代码工作得很好! -->

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)

编辑 2:

原来 PyInstaller 没有正确导入所有模块,必须显式导入对象,例如smartsheet.首页

【问题讨论】:

标签: python api pyinstaller smartsheet-api


【解决方案1】:

我有类似的问题,

为了解决我使用from smartsheet import Smartsheet 而不是import smartsheet

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-06-29
    • 2019-09-15
    • 1970-01-01
    • 2016-05-11
    • 1970-01-01
    • 2010-09-11
    • 1970-01-01
    相关资源
    最近更新 更多