0

I'm getting the following error in Python 3.10:

Traceback (most recent call last): File ".../smartsheet.py", line 13, in action = smartsheet.Sheets.list_sheets(include_all=True) AttributeError: module 'smartsheet' has no attribute 'Sheets'

Environment: Python 3.10.5 (v3.10.5:f377153967, Jun 6 2022, 12:36:10) [Clang 13.0.0 (clang-1300.0.29.30)] Mac OS 12.5, M1 MacBook Pro PyCharm 2022.1.4 (Professional Edition) smartsheet-python-sdk-py39 (2.105.1.10) and smartsheet-python-sdk (2.177.1)

import smartsheet
import logging

TOKEN = '<<suppressed for security>>'

logging.getLogger('smartsheet').setLevel(logging.CRITICAL)
smart = smartsheet.Smartsheet(access_token=TOKEN)
action = smartsheet.Sheets.list_sheets(include_all=True)
print(action) # Just a placeholder to set a breakpoint

Code is pulled out of the project samples, so I'm confused. Any help appreciated.

seayak
  • 204
  • 1
  • 3
  • 10

1 Answers1

0

I realize this is an old question so you may have already found an answer, but I'll answer for anyone else that may come looking. The "Sheets" (and other) classes are accessed through the smartsheet_client object (in your case "smart").

For example:

import smartsheet
import logging

TOKEN = '<<suppressed for security>>'

logging.getLogger('smartsheet').setLevel(logging.CRITICAL)
smart = smartsheet.Smartsheet(access_token=TOKEN)
action = smart.Sheets.list_sheets(include_all=True) # <--This is the change
print(action) # Just a placeholder to set a breakpoint