英文:
BigQuery error: AttributeError: 'ClientOptions' object has no attribute 'api_audience'
问题
我在调用BigQuery查询结果的to_dataframe()
方法时不断收到这个错误消息:AttributeError: 'ClientOptions'对象没有属性'api_audience'
。在同一个虚拟环境中之前可以正常工作,但现在不确定发生了什么。
query.result()
没有引发错误,但query.to_dataframe()
引发了错误。
这些是我安装的包版本:
- google-cloud==0.34.0
- google-cloud-bigquery==2.34.3
- google-cloud-bigquery-storage==2.16.2
- google-cloud-core==2.3.2
- google-cloud-storage==2.7.0
英文:
I keep receiving this error AttributeError: 'ClientOptions' object has no attribute 'api_audience'
once I call the to_dataframe()
on the query result from BigQuery. This worked fine before using the same virtual env and not sure what's happening now.
query.result()
didn't raise errors but query.to_dataframe()
raised the error.
These are the packages I have:
google-cloud==0.34.0
google-cloud-bigquery==2.34.3
google-cloud-bigquery-storage==2.16.2
google-cloud-core==2.3.2
google-cloud-storage==2.7.0
答案1
得分: 1
错误可能与google-cloud-core包与其他Google Cloud包之间的版本不兼容有关。
解决这个错误有两种方法之一
pip install --upgrade google-cloud-core
另一种方法是
pip install google-cloud-bigquery==2.29.0
英文:
the error may be related to version incompatibility between the google-cloud-core package and other Google Cloud packages.
there are two ways to solve that error
> pip install --upgrade google-cloud-core
and the other one is a
> pip install google-cloud-bigquery==2.29.0
答案2
得分: 0
我能够重现你的错误,这是当我将google-api-core
包降级到2.7.3
版本时出现的。
这个问题可以通过将你的google-api-core
升级到2.8.0
或更高版本来解决。但是最佳实践是始终保持你的包更新到最新版本。你可以通过运行以下命令将你的包升级到最新版本。
pip install google-api-core --upgrade
英文:
I was able to replicate your error and this is when I downgraded my google-api-core
package to 2.7.3
.
This can be resolved by upgrading your google-api-core
to 2.8.0
and up. But the BEST PRACTICE is to always keep your packages to the latest version. You may upgrade your package to latest version by running below command.
pip install google-api-core --upgrade
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论