本文介绍了如何在Python中安装gcp?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

许多BigQuery示例都以以下内容开头:

  import gcp.bigquery as bq 

但是我得到 ImportError:无模块名为gcp.bigquery ,每当我尝试运行这个。

如何安装这个库?

我正在使用python 2.7开发virtualenv。我试过 pip install gcp pip install gcloud pip install google-api -python客户端

没有一个帮助,我找不到任何文档。帮助!

更新:我想使用 gcp 的原因是我想从BigQuery获取数据,最好以CSV格式,从Python脚本中。如果还有更好的方法可以做到这一点,那么我就是所有人......

解决方案

你应该尝试一下简单的:

  $ pip install --upgrade google-api-python-client 

详见,所以如果您仍然对此感兴趣,您应该从这个角度尝试。


Lots of the BigQuery examples begin with:

import gcp.bigquery as bq

But I get ImportError: No module named gcp.bigquery whenever I try to run this.

How do I install this library?

I'm working in a virtualenv with python 2.7. I've tried pip install gcp, pip install gcloud, and pip install google-api-python-client.

None of them help and I can't find any documentation. Help!

UPDATE: the reason I want to use gcp is that I want to get data from BigQuery, preferably in CSV form, from within a Python script. If there's a better way to do this, I'm all ears...

解决方案

You should try a simple:

$ pip install --upgrade google-api-python-client

as discussed in the documentation.

Furthermore, gcp.bigquery is part of Google Cloud DataLab, so you should try from that angle if you are still interested.

这篇关于如何在Python中安装gcp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 06:47