google-cloud-platform - 在 VM 实例上使用 Jupyter 并访问 BigQuery:“无法访问本地主机”
问题描述
我在 Google Cloud - Compute Engine 上创建了一个 VM 实例。我已经在实例上安装了 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
我尝试单击链接进行身份验证,但出现“无法访问本地主机”错误。
解决方案
我有同样的问题,并通过pandas-gbq
使用conda
包管理器安装解决了它。
conda install pandas-gbq --channel conda-forge
pandas-gbq
通过安装时似乎缺少一些链接pip
推荐阅读
- python - 需要使用键值对创建字典的 Python 级别结构
- javascript - 使用 JavaScript 后 URL 未加载
- python - 将文件从公共目录移动到具有相同名称的不同文件夹
- python - 如何使用 python 读取 POST 请求内容
- python - 当模块已经安装时,获取烧瓶失败导入烧瓶-mysqldb的错误
- python - 无法加载keras的模型
- python - 我将如何下载 stackoverflow android 数据集?
- node.js - Firebase 实时数据库事务处理程序大部分时间被调用两次
- java - 如何从android中的两个文本框之一获取输入?
- python - 如果代理不工作或python出错,如何确保请求失败?