import pyarrow not working <- 错误是“ValueError: The pyarrow library is not installed, please install pyarrow to use the to_arrow() function."; [英] import pyarrow not working <- error is "ValueError: The pyarrow library is not installed, please install pyarrow to use the to_arrow() function."
问题描述
我尝试在终端和 juypter 实验室中安装它,它说它已成功安装,但是当我运行 df = query_job.to_dataframe() 时,我不断收到错误;ValueError: pyarrow 库未安装,请安装 pyarrow 以使用 to_arrow() 函数.".我不知道如何解决这个问题.有什么建议吗?我试图最终使用代码从谷歌数据工作室访问数据,
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()
推荐答案
我在测试 Python 代码时收到相同的错误消息 ModuleNotFoundError: No module named 'pyarrow'
.使用 pip install pyarrow
安装 pyarrow
依赖项后,此行为消失.
I got the same error message ModuleNotFoundError: No module named 'pyarrow'
when testing your Python code. This behavior disappeared after installing the pyarrow
dependency with pip install pyarrow
.
在运行 pip install pyarrow
这篇关于import pyarrow not working <- 错误是“ValueError: The pyarrow library is not installed, please install pyarrow to use the to_arrow() function.";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!