TypeError: request() got an unexpected keyword argument 'json' when opening Sheet
See original GitHub issueWhen attempting to open a spreadsheet with following function:
def openSS(bookName, sheetName):
if not os.path.isfile(gsJSONFile):
print("JSON client file does not exist!")
sys.exit(2)
scope = ['https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name(gsJSONFile, scope)
gc = gspread.authorize(credentials)
wks = gc.open(bookName).worksheet(sheetName)
return wks
I’m getting this error, but I don’t get it when running exact same file on a Macbook Pro:
File "github/Scripts/Python/weather.py", line 268, in autoMode
wks = openSS("Weather API", "Current")
File "github/Scripts/Python/weather.py", line 51, in openSS
wks = gc.open(bookName).worksheet(sheetName)
File "/usr/local/lib/python2.7/dist-packages/gspread/client.py", line 82, in open
feed = self.get_spreadsheets_feed()
File "/usr/local/lib/python2.7/dist-packages/gspread/client.py", line 155, in get_spreadsheets_feed
r = self.session.get(url)
File "/usr/local/lib/python2.7/dist-packages/gspread/httpsession.py", line 73, in get
return self.request('GET', url, params=params, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/gspread/httpsession.py", line 65, in request
response = func(url, data=data, params=params, headers=request_headers, files=files, json=json)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 467, in get
return self.request('GET', url, **kwargs)
TypeError: request() got an unexpected keyword argument 'json'
Operating System: Ubuntu 14.04 Python version: 2.7.6 gspread version: just re-installed it with pip, so latest.
Thanks in advance!
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
request() got an unexpected keyword argument 'json' [duplicate]
I need to send data as json with requests module in Python. For example: import json import requests f = requests.Session() data =...
Read more >TypeError: request() got an unexpected keyword argument 'json ...
When attempting to open a spreadsheet with following function: def openSS(bookName, sheetName): if not os.path.isfile(gsJSONFile): print("JSON client file ...
Read more >request() got an unexpected keyword argument 'req_params'
Hello! I have recently become the primary caretaker of Bodhi and I've inherited a number of issues related to bodhi 0.9.
Read more >pandas.ExcelWriter — pandas 1.5.2 documentation
Class for writing DataFrame objects into excel sheets. Default is to use: ... NOTE: can only be passed as a keyword argument. ......
Read more >st.json - Streamlit Docs
st.json displays object or string as a pretty-printed JSON string. ... Defaults to True. This argument can only be supplied by keyword.
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 Free
Top 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

Solved by updating requests package.
Solved this via sudo pip3 requests --upgarde as well