导入pyarrow无法正常运行-错误为"ValueError:未安装pyarrow库,请安装pyarrow以使用to_arrow()函数." [英] import pyarrow not working <- error is "ValueError: The pyarrow library is not installed, please install pyarrow to use the to_arrow() function."

查看:496
本文介绍了导入pyarrow无法正常运行-错误为"ValueError:未安装pyarrow库,请安装pyarrow以使用to_arrow()函数."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在终端和juypter实验室中安装它,并说它已经成功安装,但是当我运行df = query_job.to_dataframe()时,我一直收到错误消息 ValueError:未安装pyarrow库,请安装pyarrow以使用to_arrow()函数.".我不知道该如何解决.有什么建议吗?我试图最终使用代码从Google Data Studio访问数据,

I have tried installing it in the terminal and in juypter lab and it says that it has been successfully installed but when I run df = query_job.to_dataframe() I keep getting the error " ValueError: The pyarrow library is not installed, please install pyarrow to use the to_arrow() function.". I have no idea how to fix this. Any advice? I am trying to access data from google data studio ultimately with the code,

from google.cloud import bigquery
import pandas
import numpy
import pyarrow
bigquery_client = bigquery.Client()
import os 
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] ='full file path here.json'
QUERY = """
SELECT * 
FROM `warehouse`
LIMIT 100
"""
query_job = bigquery_client.query(QUERY)
df = query_job.to_dataframe()

推荐答案

我遇到了同样的问题,因为我有pyarrow 2.0,但是您将需要版本1.0.1. 尝试运行以下行:pip install pandas-gbq == 0.14.0

I had the same issue because I had pyarrow 2.0, however you will need version 1.0.1 . Try running this line: pip install pandas-gbq==0.14.0

这篇关于导入pyarrow无法正常运行-错误为"ValueError:未安装pyarrow库,请安装pyarrow以使用to_arrow()函数."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆