首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何将R的光栅库添加到Sagemaker的AMI linux实例?

如何将R的光栅库添加到Sagemaker的AMI linux实例?
EN

Stack Overflow用户
提问于 2021-12-20 13:38:41
回答 1查看 112关注 0票数 0

这是我对笔记本的生命周期配置,但是光栅在安装步骤中失败了.

我从下面的线程中获得了一些建议,它们安装了与地理空间处理相关的依赖关系,但没有成功。

github头

我还纳入了EPEL,这是aws对这些案件的建议。

代码语言:javascript
复制
sudo -b  yum --enablerepo=epel

我在conda环境中安装了所有的库

代码语言:javascript
复制
set -e
# OVERVIEW
# This script installs a single conda R package (bigmemory) in SageMaker R environment.
# To install an R package with conda, the package needs to be prefixed with 'r-'. For example, to install the package `shiny`, run 'conda install -c r r-shiny'.
 
nohup sudo -b -u ec2-user -i <<'EOF'

nohup sudo -b  yum --enablerepo=epel


# First, we need to install the lustre-client libraries
# https://stackoverflow.com/questions/20923209/problems-installing-the-devtools-package
nohup sudo -b yum install -y \
    libgeos \
    libgdal-dev \
    libgeos-dev \
    libproj-dev \
    libgdal-devel \
    libgeos-devel \
    libproj-devel \
    libcurl \
    libcurl-devel \
    openssl-devel \
    libxml2-devel  

echo "PASS STAGE 1 "

# libgdal1 libgdal1-dev libgeos libgeos-dev
source activate R

nohup conda install -y -c r r-binutils &
nohup conda install -y -c r r-libgit2 & 
nohup conda install -y -c r r-libxml2-devel &  

nohup conda install -y -c r r-devtools   &

nohup conda install -y -c r r-remotes   &
nohup conda install -y -c r r-units   &
nohup conda install -y -c r r-sf    &
nohup conda install -y -c r r-terra   &
nohup conda install -y -c r r-spData  &
nohup conda install -y -c r r-spdep  & 
nohup conda install -y -c r r-raster  &  ##this can not install
nohup conda install -y -c r r-reshape2  &
nohup conda install -y -c r r-DescTools  &
nohup conda install -y -c r r-spdep  &
nohup conda install -y -c r r-xgboost  &
nohup conda install -y -c r r-dplyr  &
nohup conda install -y -c r r-readr   &
nohup conda install -y -c r r-readxl   &
nohup conda install -y -c r r-paws   & 
nohup conda install -y -c r r-botor   &


echo "PASS STAGE 2 "
#outForest
nohup conda install -y -c r r-RcppEigen &
nohup conda install -y -c r r-FNN &
nohup conda install -y -c r r-ranger &
nohup conda install -y -c r r-missRanger &

nohup conda install -y -c r r-outForest &
 
echo "PASS STAGE 3 "
conda deactivate
EN

回答 1

Stack Overflow用户

发布于 2021-12-22 02:25:56

最后,这里的成功脚本之一是使用与unix返回载体兼容的文本编辑器。

在创建或更改脚本时,我们建议您使用提供Unix样式换行的文本编辑器,例如创建笔记本时控制台中可用的文本编辑器。从非Linux操作系统复制文本可能会导致不兼容的换行并导致意外错误。

代码语言:javascript
复制
#!/bin/bash
 
set -e

sudo -u ec2-user -i <<'EOF'

nohup yum -y install  gcc gcc-c++ clang  libcurl-devel    openssl-devel  | "FAIL LINUX DEPS"

source activate R 
nohup conda install -y -c r r-sf &
nohup conda install -y -c r r-raster=3.4-10 & 
nohup conda install -y -c r r-dplyr         &
nohup conda install -y -c r r-readr     &
nohup conda install -y -c r r-readxl    &
nohup conda install -y -c r r-paws      & 
nohup conda install -y -c r r-botor     & 
 
conda deactivate
 
EOF

AWS LifeCicleConf

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70422687

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档