aws / amazon-sagemaker-examples

Example 📓 Jupyter notebooks that demonstrate how to build, train, and deploy machine learning models using 🧠 Amazon SageMaker.
https://sagemaker-examples.readthedocs.io
Apache License 2.0
10.14k stars 6.78k forks source link

Cannot install rJava #262

Closed ssmostagh closed 6 years ago

ssmostagh commented 6 years ago

I'm creating a SageMaker notebook using R, and I installed the R Kernel correctly so that I can run R inside a Jupyter notebook. There are a few issues I've noticed with installing packages, but they can usually be circumvented by adding a specific repository source, specifying the dependencies, etc. However, there is one package that doesn't follow these workarounds: rJava.

Can rJava be installed in SageMaker?

Background:

When I try to install the library "RWeka" there is an issue that I can't get around. I've traced to the error down to the dependency on the "rJava" package. I've entered the following commands:

install.packages('rJava') install.packages('rJava', repos = 'https://cran.r-project.org/') This results in the following error:

“installation of package ‘rJava’ had non-zero exit status”Updating HTML index of packages in '.Library' I suspect this is because rJava has system requirements of "Java JDK 1.2 or higher (for JRI/REngine JDK 1.4 or higher), GNU make."

SageMaker's Java JDK is 1.8.0_121 so I'm not sure what the issue is, I've tried installing in the terminal and multiple variants of R using devtools library, etc. Is rJava not supported?

djarpin commented 6 years ago

Hi @mostags . I was able to install rJava using the conda command !conda install --yes --name JupyterSystemEnv -c r r-rjava. Can you try this an let me know if it works for you? Thanks.

djarpin commented 6 years ago

Closing due to inactivity. Feel free to re-open if necessary. Thanks.

acjones27 commented 5 years ago

Hi

I'm having the same issue with not being able to install rJava. @djarpin I tried running that command via the r jupyter notebook but it doesn't seem to recognise bash commands. I can't run anything starting with "!" without getting an "unexpected symbol" command.

Could you help me with this?

Thanks

Roopali24 commented 4 years ago

Hi,

You need to run the following command: !conda install --yes --name JupyterSystemEnv -c r r-rjava in the terminal, provided you have conda installed in your computer.

Then go to AWS Sagemaker Notebooks and then go to conda. Check the R environment and search for rjava and install it. To verify, check library("rJava") in your notebook.