Python Pi上的GSPREAD:SyntaxError:应为路径分隔符([)

Python Pi上的GSPREAD:SyntaxError:应为路径分隔符([),python,gspread,Python,Gspread,我在使用gspread从pi访问google drive电子表格时遇到问题。使用以下代码-我已将python移动到空闲状态,以尝试解决此问题 >>> import gspread >>> gc = gspread.login('username', 'password') >>> spreadsheet=gc.open('Spreadsheet') >>> Log_sheet = spreadsheet.worksheet(

我在使用gspread从pi访问google drive电子表格时遇到问题。使用以下代码-我已将python移动到空闲状态,以尝试解决此问题

>>> import gspread
>>> gc = gspread.login('username', 'password')
>>> spreadsheet=gc.open('Spreadsheet')
>>> Log_sheet = spreadsheet.worksheet("Sheet1")
>>> Log_sheet.acell('B1').value
'Value @ B1'`
我已经尝试在命令行中使用我的计算机检查版本中的相同代码,它与上面的结果很好地工作。我已经在我的pi上更新了版本

错误发生在pi的第>>>行Log\u sheet=spreadsheet.worksheetSheet1之后 因此,我已经登录并访问了谷歌电子表格——它正在访问工作表——它确实存在,我可以从我的计算机上访问。我还在Raspberry Pi网站上发布了一个求助请求

有人能帮忙吗?这是错误输出

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.1/dist-packages/gspread/models.py", line 123, in worksheet
self._fetch_sheets()
File "/usr/local/lib/python3.1/dist-packages/gspread/models.py", line 62, in _fetch_sheets
self._sheet_list.append(Worksheet(self, elem))
File "/usr/local/lib/python3.1/dist-packages/gspread/models.py", line 168, in __init__
self.version = element.find(_ns("link[@rel='edit']")).attrib['href'].split('/')[-1]
File "/usr/lib/python3.1/xml/etree/ElementTree.py", line 305, in find
return ElementPath.find(self, path)
File "/usr/lib/python3.1/xml/etree/ElementPath.py", line 186, in find
return _compile(path).find(element)
File "/usr/lib/python3.1/xml/etree/ElementPath.py", line 176, in _compile
p = Path(path)
File "/usr/lib/python3.1/xml/etree/ElementPath.py", line 93, in __init__
"expected path separator (%s)" % (op or tag)
SyntaxError: expected path separator ([)
我也尝试过重新安装elementtree,因为我看到这可能是我搜索答案的一种可能性,我也在pi上尝试过python 3.1,仍然没有乐趣


任何人都可以帮忙吗?我认为这很容易,但我没有看到它。

它与gspread本身中ElementTree API的不兼容使用有关,它存在。

这是一个bug;转到gspread/models.py并将第168行改为self.version=self.\u get_link'edit',element.get'href'/'[-1]。或者更新gspread。