Installing R Packages in Jupyter rstatix
I am able to install some R packages in my Jupyter Workspace (tidyverse, ggplot2), but others I hit a wall, getting an error like:
“installation of package ‘rstatix’ had non-zero exit status” Updating HTML index of packages in '.Library'
The current one I'm struggling with is rstatix, which is a pretty popular library and a dependency of several other libraries I'd like to use.
Does anyone have good troubleshooting tips for installing libraries that won't install?
Please 💡/💖/👍/😊 this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
Best Answer
-
I think I found a solution (at least for rstatix), but hopefully this helps with others as well:
A dependency of a lot of R packages is the 'nloptr' package (including rstatix), which in turn requires 'cmake'. I believe cmake should be available on the operating system already, but for some reason the Jupyter environment can't see it. I was able to install cmake using a terminal with this:
pip install cmake
Then, I was able to run install.packages('rstatix') in a notebook. This took over 5 minutes to execute.
Also, throughout the troubleshooting process, I had to "restore kernel defaults" a bunch of times. I would know I needed to do this because I would try installing a package like ggplot2 that I was able to install before, but would get an error. You should definitely start with this, and then if something doesn't work, do it again.
Please 💡/💖/👍/😊 this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
2
Answers
-
I don't work with R, but I have a friend who has significant R experience. Passing this along….
- Check Internet Connection: Ensure that your internet connection is stable and that you can access CRAN (Comprehensive R Archive Network), where R packages are hosted. Sometimes, network issues can lead to failed installations.
- Update R and RStudio: Make sure you are using the latest versions of R and RStudio. Older versions may have compatibility issues with newer packages.
- Check Package Dependencies: Some R packages depend on other software or libraries that need to be installed separately. Make sure you have all the necessary dependencies installed on your system.
- Install System Dependencies: Certain R packages require system-level dependencies to be installed. These dependencies may include external libraries or tools. You can often find information about required system dependencies in the package documentation or on the package's CRAN page.
- Check Package Documentation: Review the documentation for the package you are trying to install. Sometimes, package authors provide specific instructions or troubleshooting tips for installation.
- Try Installing from Source: Instead of installing the package binary, try installing the package from source. You can do this by setting
type = "source"
in theinstall.packages()
function.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
Unfortunately, I cannot update the version of R, since that's managed by Domo. I'm working through dependencies, but it's turtles all the way down. They get the same error. I'll play with 'try installing from source', but I'm curious if anyone has any actual experience with Jupyter and R? Most of the documentation and troubleshooting online is geared (like this answer from ArborRose) to RStudio, which is installed locally.
Please 💡/💖/👍/😊 this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
0 -
I think I found a solution (at least for rstatix), but hopefully this helps with others as well:
A dependency of a lot of R packages is the 'nloptr' package (including rstatix), which in turn requires 'cmake'. I believe cmake should be available on the operating system already, but for some reason the Jupyter environment can't see it. I was able to install cmake using a terminal with this:
pip install cmake
Then, I was able to run install.packages('rstatix') in a notebook. This took over 5 minutes to execute.
Also, throughout the troubleshooting process, I had to "restore kernel defaults" a bunch of times. I would know I needed to do this because I would try installing a package like ggplot2 that I was able to install before, but would get an error. You should definitely start with this, and then if something doesn't work, do it again.
Please 💡/💖/👍/😊 this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
2
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 101 SQL DataFlows
- 622 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 748 Beast Mode
- 59 App Studio
- 41 Variables
- 686 Automate
- 176 Apps
- 453 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 396 Distribute
- 113 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 125 Manage
- 122 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 109 Community Announcements
- 4.8K Archive