google-bigquery - GCE 上没有名为 'google.cloud._helpers' 的模块

标签 google-bigquery google-compute-engine google-cloud-python

在 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

enter image description here

更多信息here .

关于google-bigquery - GCE 上没有名为 'google.cloud._helpers' 的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53173371/

相关文章:

google-cloud-platform - Google 负载均衡器在超时后在网络服务器上重试请求

google-cloud-platform - 尽管已安装在 venv 中,但未找到 google-cloud-storage 发行版

google-app-engine - 在 GAE 中使用 gcloud-python

google-cloud-platform - Terraform Bigquery 创建表替换表而不是编辑

sql - BigQuery - 对结构数组求和

GCE 上的 Python : connection failed because connected host has failed to respond

google-compute-engine - Google Deploy Manager(无效的配置文件 : Template fetching failed/Failed to find resource)

python - 尝试从 docker 容器访问时,Datastore 返回 503

google-analytics - Bigquery GA360 每日导出 : find earliest daily table

sql - 大查询 SQL : Identify time ranges of minimum length where condition is met