smartsheet-platform / smartsheet-python-sdk

Library that uses Python to connect to Smartsheet services (using API 2.0).
Apache License 2.0
136 stars 81 forks source link

AttributeError: 'str' object has no attribute 'get_sheet' with Pyinstaller #145

Closed Tribruin closed 4 years ago

Tribruin commented 4 years ago

Any suggestion on why I would be getting the following error when running a compiled version of a working script:

AttributeError: 'str' object has no attribute 'get_sheet'

the two lines of code generating the error are: sheets = ss.Smartsheet(accessToken) response = sheets.Sheets.get_sheet(sheetID)

This same code works just fine as a regular python script.

Tribruin commented 4 years ago

Following up on my issue. I found that I have to add hidden imports to Pyinstaller. I have found the best way is to use a spec file. I had to play around with the proper hidden imports until I found the right combination. Here is the relevant portion of my spec file:

hiddenimports=[ 'smartsheet.models', 'smartsheet.sheets', 'smartsheet.search', 'smartsheet.attachments' ],

Abhishek-maurya-19 commented 4 years ago

Following up on my issue. I found that I have to add hidden imports to Pyinstaller. I have found the best way is to use a spec file. I had to play around with the proper hidden imports until I found the right combination. Here is the relevant portion of my spec file:

hiddenimports=[ 'smartsheet.models', 'smartsheet.sheets', 'smartsheet.search', 'smartsheet.attachments' ],

Thank you. This helped me also!