'Worksheet' object has no attribute 'get_values'
See original GitHub issueDescribe the bug Today I started to get this error in Google Colab… ‘Worksheet’ object has no attribute ‘get_values’ Yesterday I had a problem in the authorization to connect with gspread, but it was resolved. But now this error appeared despite the code being the same.
To Reproduce Try to use this following code with google colab (with some personal worksheet):
!pip install --upgrade gspread
!apt-get update # to update ubuntu to correctly run apt install
import gspread
from google.colab import auth
from google.auth import default
auth.authenticate_user()
creds, _ = default()
gc = gspread.authorize(creds)
url_sheet = "https://docs.google.com/spreadsheets/d/.../"
sheet = gc.open_by_url(url_sheet)
wsheet_values = sheet.worksheet('Sheet Name').get_values('A:G') #line with error
You can also try to import just the function:
from gspread.worksheet.Worksheet import get_values
And it returns to me this error: “cannot import name ‘Dimension’ from ‘gspread.utils’ (/usr/local/lib/python3.7/dist-packages/gspread/utils.py)”
Expected behavior It was suposed to return the data in the specified range as lists within a list
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
'Worksheet' object has no attribute 'get_values' - Stack Overflow
I just solved the problem replacing "get_values" with "get": url_sheet = "https://docs.google.com/spreadsheets/d/.../" sheet ...
Read more >Getting error " 'NoneType' object has no attribute 'getvalues' "
[Solved]-Getting error " 'NoneType' object has no attribute 'getvalues' "-Pandas,Python ... The conflict comes from keeping the same names for different objects.
Read more >The Workbook Class — XlsxWriter Documentation
The Worksheet object is used to write data and configure a worksheet in the workbook. The name parameter is optional. If it is...
Read more >Class Sheet | Apps Script - Google Developers
Returns the URL for the form that sends its responses to this sheet, or null if this sheet has no associated form. getFrozenColumns(),...
Read more >Reading Spreadsheets with OpenPyXL and Python
Read all cells in all sheets. You can get started by learning how to open a workbook in the next section! Open a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Be aware you did not solve your problem, you only worked around it. This workaround is very close but there is a difference between
get
andget_values
get
will return the range you request.get_values
will return the range but it will keep the shape of the range and put empty values when the cells are empty. Inget
you don’t receive the empty values.Make sure this does not brake your script.
In fact this is odd. It looks like some import broke down in the latest release. I will look at it