You need to enable JavaScript to run this app. 如何在RStudio Cloud中安装带lz4支持的arrow包?
优惠活动
大模型
产品
解决方案
定价
更多

如何在RStudio Cloud中安装带lz4支持的arrow包?

操作步骤

1. 安装系统依赖

打开RStudio Cloud的终端界面,依次执行以下命令:

# 添加openssl1.0对应的软件源
echo "deb http://security.ubuntu.com/ubuntu bionic-security main" | sudo tee -a /etc/apt/sources.list.d/bionic.list
sudo apt update
# 安装缺失的依赖库及lz4、arrow运行所需的系统组件
sudo apt install -y libssl1.0.0 liblz4-dev libarrow-dev

2. 安装带lz4支持的arrow包

回到R控制台,运行以下代码:

# 配置编译参数,强制启用lz4支持
Sys.setenv(
  ARROW_WITH_LZ4 = "ON",
  ARROW_USE_PKG_CONFIG = "ON",
  LIBARROW_MINIMAL = "OFF"
)
# 安装适配RStudio Cloud环境的arrow包
install.packages("arrow", repos = "https://packagemanager.rstudio.com/cran/__linux__/focal/latest")

3. 功能验证

安装完成后运行以下代码验证配置是否生效:

library(arrow)
# 检查lz4支持状态,返回TRUE即为配置成功
arrow_info()$capabilities[["lz4"]]

确认返回TRUE后即可正常调用arrow::read_feather()读取lz4压缩的feather文件。


内容的提问来源于stack exchange,提问作者Cullen.Molitor

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.21 09:24:05