0

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

shawn kumar
  • 59
  • 1
  • 8

2 Answers2

1

I had a similar issue,

To resolve I used from smartsheet import Smartsheet instead of import smartsheet

0

Edit #2 above was the key to fixing this issue for me, but the syntax was unclear.

My original import statement was: from smartsheet import Smartsheet. With this import statement, I had no issues running my code from my .py file.

In order to get my code to run from the .exe file that pyinstaller created, I had to change my import statement to: from smartsheet import Smartsheet, home, folders, sheets. (Case sensitive)

(My code referenced Home, Folder, and Sheet objects.)

G. Maniatis
  • 121
  • 9