在 GCE 上导入 google.cloud.bigquery
时出现错误。
它不会发生在非 GCE 的环境中。
我使用 pip
执行了更新。
你知道为什么吗?
user1@sv1:~$ python
Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016,12:22:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from google.cloud import bigquery
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user1/miniconda3/lib/python3.6/site-packages/google/cloud/bigquery/__init__.py", line 34, in <module>
from google.cloud.bigquery.client import Client
File "/home/user1/miniconda3/lib/python3.6/site-packages/google/cloud/bigquery/client.py", line 32, in <module>
import google.cloud._helpers
ModuleNotFoundError:没有名为“google.cloud._helpers”的模块
2018 年 11 月 11 日添加 谢谢您的回答。 自从使用 pyenv 创建一个新的 python 以来它就不起作用了,我认为我的服务器出了问题。 我重置了服务器并重试。
最佳答案
2018 年 6 月,Google 弃用了 google.cloud
Python 包。您需要直接使用 pip install --upgrade google-cloud-bigquery
直接使用 BigQuery 模块,而不是 pip install --upgrade google-cloud
。
更多信息here .
关于google-bigquery - GCE 上没有名为 'google.cloud._helpers' 的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53173371/