1

I am using amazon sagemaker notebook instance. And i am trying to install lidR package into R notebook but i got following errors. How can i. Solve it?

Code;

install.packages("lidR")

Error;

installing the dependencies ‘units’, ‘lwgeom’, ‘raster’, ‘sf’, ‘stars’, ‘terra’
    
    
    Warning message in install.packages("lidR"):
    “installation of package ‘units’ had non-zero exit status”
    Warning message in install.packages("lidR"):
    “installation of package ‘terra’ had non-zero exit status”
    Warning message in install.packages("lidR"):
    “installation of package ‘raster’ had non-zero exit status”
    Warning message in install.packages("lidR"):
    “installation of package ‘sf’ had non-zero exit status”
    Warning message in install.packages("lidR"):
    “installation of package ‘lwgeom’ had non-zero exit status”
    Warning message in install.packages("lidR"):
    “installation of package ‘stars’ had non-zero exit status”
    Warning message in install.packages("lidR"):
    “installation of package ‘lidR’ had non-zero exit status”
    Updating HTML index of packages in '.Library'
    
    Making 'packages.html' ...
     done
Sevval Kahraman
  • 1,185
  • 3
  • 10
  • 37
  • Is that the entire output? Normally the specific error is included somewhere in the output. This just seems to be the final lines that a failure occurred somewhere but does not say what the failure is. – MrFlick May 23 '22 at 15:48
  • @MrFlick this is the only output that shown :/ – Sevval Kahraman May 23 '22 at 15:52
  • @MrFlick the same line works normal for ex in kaggle notebook. – Sevval Kahraman May 23 '22 at 15:53
  • Those are all moderately more-complex packages _with build-dependencies_ you will have to take care of. You can search for posts on individual package, for example `sf` or `units`. And importantly, you can see more if you break it down. Start with, say, `install.packages("units")` and you will likely see an error that you need the 'udunits' library. So install that, try again. And on to the next package. (Aside: there are some Linux flavours for which you can get binaries: Fedora, OpenSUSE and now Ubuntu -- see https://eddelbuettel.github.io/r2u/) – Dirk Eddelbuettel May 23 '22 at 15:58
  • Just an option to consider. You might be lacking some libraries like `libudunits` or `libgdal`. They are installed outside the R environment. – Serhii Jul 13 '22 at 21:10

1 Answers1

1

Use conda to install the package

Open a terminal on your JupyterLab instance and run the following commands:

conda init bash
source ~/.bashrc
conda activate R
conda install -c conda-forge r-lidr

You should be able to library(lidR) on your notebook after that (restart the R kernel if needed)

gris
  • 11
  • 2