代码之家  ›  专栏  ›  技术社区  ›  Nivi

在VM实例上使用jupyter并访问bigquery:“无法访问本地主机”

  •  1
  • Nivi  · 技术社区  · 8 年前

    我在谷歌云计算引擎上创建了一个虚拟机实例。我已经在实例上安装了jupyter。现在,我想使用笔记本直接查询bigquery上的表,并使用结果进行分析。

    我目前正在做以下工作:

    R = pd.read_gbq(query=Q,project_id = projecti, dialect = 'standard')
    R.head()
    

    在哪里? Q 是我的疑问。

    我得到以下输出:

    Your browser has been opened to visit:
    
    https://accounts.google.com/o/oauth2/v2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fbigquery&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&response_type=code&client_id=333.apps.googleusercontent.com&access_type=offline
    
    If your browser is on a different machine then exit and re-run this
    application with the command-line parameter
    
      --noauth_local_webserver
    

    我尝试单击链接进行身份验证,然后出现“无法访问本地主机”错误。

    1 回复  |  直到 8 年前
        1
  •  2
  •   gruby    8 年前

    我有同样的问题,通过安装 pandas-gbq 使用 conda 包管理器。

    conda install pandas-gbq --channel conda-forge

    似乎有一些链接丢失,当 熊猫GBQ 通过安装 pip