I am trying to host a shiny app on an AW2 instance with ubuntu. This is the first time I have tried using an EC2 instance and the last package I need to install, "shinymanager" for the app is giving a non-zero exit status. Please let me know how to install "shinymanager" to the shiny-server on my ubuntu ec2 instance.
Ubuntu version: 18.04+
R version: R version 4.1.2 (2021-11-01) -- "Bird Hippie"
All the below packages have installed successfully through this method:
/srv/shiny-server$ sudo R
install.packages(c("package name"), dependencies = T)
Packages present in Global file that installed properly
library(tidyverse)
library(here)
library(janitor)
#library(lubridate)
#library(RPostgres)
#library(rstudioapi)
library(shinyWidgets)
library(DT)
#library(glue)
library(shinycssloaders)
#library(DBI)
library(gargle)
library(shinyalert)
library(googledrive)
library(shinylogs)
library(cachem)
library(shinymanager)
Here is the data and error I receive when trying install.packages("shinymanager", dependencies = T)
install.packages("shinymanager", dependencies = T)
Installing package into ‘/root/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
also installing the dependencies ‘sodium’, ‘RSQLite’, ‘keyring’
trying URL 'https://cloud.r-project.org/src/contrib/sodium_1.2.1.tar.gz'
Content type 'application/x-gzip' length 468055 bytes (457 KB)
==================================================
downloaded 457 KB
trying URL 'https://cloud.r-project.org/src/contrib/RSQLite_2.2.20.tar.gz'
Content type 'application/x-gzip' length 3745301 bytes (3.6 MB)
==================================================
downloaded 3.6 MB
trying URL 'https://cloud.r-project.org/src/contrib/keyring_1.3.1.tar.gz'
Content type 'application/x-gzip' length 45779 bytes (44 KB)
==================================================
downloaded 44 KB
trying URL 'https://cloud.r-project.org/src/contrib/shinymanager_1.0.410.tar.gz'
Content type 'application/x-gzip' length 2191864 bytes (2.1 MB)
==================================================
downloaded 2.1 MB
* installing *source* package ‘sodium’ ...
** package ‘sodium’ successfully unpacked and MD5 sums checked
** using staged installation
Package libsodium was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsodium.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsodium' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lsodium
--------------------------- [ANTICONF] --------------------------------
Configuration failed because libsodium was not found. Try installing:
* deb: libsodium-dev (Debian, Ubuntu, etc)
* rpm: libsodium-devel (Fedora, EPEL)
* csw: libsodium_dev (Solaris)
* brew: libsodium (OSX)
If libsodium is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libsodium.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: fatal error: sodium.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘sodium’
* removing ‘/root/R/x86_64-pc-linux-gnu-library/4.1/sodium’
* installing *source* package ‘RSQLite’ ...
** package ‘RSQLite’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
###### Various Download info #########
The downloaded source packages are in
‘/tmp/Rtmp9w5Zc6/downloaded_packages’
Warning messages:
1: In install.packages("shinymanager", dependencies = T) :
installation of package ‘sodium’ had non-zero exit status
2: In install.packages("shinymanager", dependencies = T) :
installation of package ‘keyring’ had non-zero exit status
UPDATE
Inerestingly I was able to get shinymanager to download how ever I believe the LibPath is inccorrect. I believe I need to change it from /root/R/x86_64-pc-linux-gnu-library/4.1 to /usr/local/lib/R/site-library
I wish I could give the exact solution but I am sure why it finally worked. I tried various install.packages() specifying libpath and dependencies. I then ran into the same issue with RSQLite and that worked eventually too after it failing for many tries and combinations.
Related
Introduction
OS: Ubuntu 20.04.3 LTS
I am currently install the languageserver packages on R, to use the R VS Code extension.
Problematic
But when I execute the install.packages("languageserver") in R with the Ubuntu's terminal, I have this error:
> install.packages("languageserver")
Installing package into ‘/home/mathieu-s/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
also installing the dependencies ‘curl’, ‘httr’, ‘lintr’
trying URL 'https://cloud.r-project.org/src/contrib/curl_4.3.2.tar.gz'
Content type 'application/x-gzip' length 793345 bytes (774 KB)
==================================================
downloaded 774 KB
trying URL 'https://cloud.r-project.org/src/contrib/httr_1.4.2.tar.gz'
Content type 'application/x-gzip' length 159950 bytes (156 KB)
==================================================
downloaded 156 KB
trying URL 'https://cloud.r-project.org/src/contrib/lintr_2.0.1.tar.gz'
Content type 'application/x-gzip' length 219142 bytes (214 KB)
==================================================
downloaded 214 KB
trying URL 'https://cloud.r-project.org/src/contrib/languageserver_0.3.12.tar.gz'
Content type 'application/x-gzip' length 78124 bytes (76 KB)
==================================================
downloaded 76 KB
* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
** using staged installation
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
* deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
* rpm: libcurl-devel (Fedora, CentOS, RHEL)
* csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘curl’
* removing ‘/home/mathieu-s/R/x86_64-pc-linux-gnu-library/4.1/curl’
ERROR: dependency ‘curl’ is not available for package ‘httr’
* removing ‘/home/mathieu-s/R/x86_64-pc-linux-gnu-library/4.1/httr’
ERROR: dependency ‘httr’ is not available for package ‘lintr’
* removing ‘/home/mathieu-s/R/x86_64-pc-linux-gnu-library/4.1/lintr’
ERROR: dependency ‘lintr’ is not available for package ‘languageserver’
* removing ‘/home/mathieu-s/R/x86_64-pc-linux-gnu-library/4.1/languageserver’
The downloaded source packages are in
‘/tmp/RtmpVaqLTX/downloaded_packages’
Warning messages:
1: In install.packages("languageserver") :
installation of package ‘curl’ had non-zero exit status
2: In install.packages("languageserver") :
installation of package ‘httr’ had non-zero exit status
3: In install.packages("languageserver") :
installation of package ‘lintr’ had non-zero exit status
4: In install.packages("languageserver") :
installation of package ‘languageserver’ had non-zero exit status
But I don't know how to solve this error, can someone help me to solve this?
you should install libcurl4-openssl-dev in Ubuntu, try the following codes in Ubuntu terminal:
sudo apt update
sudo apt-get install libcurl4-openssl-dev
then try again to install languageserver package in R
After upgrading to OS X Catalina and re-installing R (since OS X now have completely migrated to 64-bit), I cannot install the packages ggiraph or gdtools. I have managed to install other packages such as ggplot2 without problem, but these doesn't work for some reason. I am hoping that someone here can help me out.
If I try to install it in R from GitHub I get:
devtools::install_github('davidgohel/ggiraph')
Pop-up:
"Install Build Tools
Building R package from source requires installation of additional build tools.
Do you want to install the additional tools now?"
But I have already install Xcode, so I don't know why I get this...
If I try to install it from CRAN I get:
install.packages("ggiraph")
also installing the dependencies ‘systemfonts’, ‘gdtools’, ‘uuid’
trying URL 'https://cran.rstudio.com/src/contrib/systemfonts_0.1.1.tar.gz'
Content type 'application/x-gzip' length 24379 bytes (23 KB)
==================================================
downloaded 23 KB
trying URL 'https://cran.rstudio.com/src/contrib/gdtools_0.2.1.tar.gz'
Content type 'application/x-gzip' length 32043 bytes (31 KB)
==================================================
downloaded 31 KB
trying URL 'https://cran.rstudio.com/src/contrib/uuid_0.1-2.tar.gz'
Content type 'application/x-gzip' length 46706 bytes (45 KB)
==================================================
downloaded 45 KB
trying URL 'https://cran.rstudio.com/src/contrib/ggiraph_0.7.0.tar.gz'
Content type 'application/x-gzip' length 372907 bytes (364 KB)
==================================================
downloaded 364 KB
installing source package ‘systemfonts’ ...
package ‘systemfonts’ successfully unpacked and MD5 sums checked
using staged installation
Using PKG_CFLAGS=
Using PKG_LIBS=-lfreetype
./configure: line 54: x86_64-apple-darwin13.4.0-clang: command not found
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because freetype2 was not found. Try installing:
deb: libfontconfig1-dev (Debian, Ubuntu, etc)
rpm: fontconfig-devel (Fedora, EPEL)
csw: fontconfig_dev (Solaris)
brew: freetype (OSX)
If freetype2 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a freetype2.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
ERROR: configuration failed for package ‘systemfonts’
* removing ‘/Users/USER/Anaconda3/anaconda3/lib/R/library/systemfonts’
Warning in install.packages :
installation of package ‘systemfonts’ had non-zero exit status
* installing source package ‘uuid’ ...
* package ‘uuid’ successfully unpacked and MD5 sums checked
* using staged installation
checking for gcc... x86_64-apple-darwin13.4.0-clang
checking whether the C compiler works... no
configure: error: in /private/var/folders/fy/d14lc6rd5nq827m06zkkb1_h0000gn/T/RtmpQUHJ12/R.INSTALL29ed73b7d534/uuid':
configure: error: C compiler cannot create executables
Seeconfig.log' for more details
ERROR: configuration failed for package ‘uuid’
* removing ‘/Users/USER/Anaconda3/anaconda3/lib/R/library/uuid’
Warning in install.packages :
installation of package ‘uuid’ had non-zero exit status
ERROR: dependency ‘systemfonts’ is not available for package ‘gdtools’
* removing ‘/Users/USER/Anaconda3/anaconda3/lib/R/library/gdtools’
Warning in install.packages :
installation of package ‘gdtools’ had non-zero exit status
ERROR: dependencies ‘gdtools’, ‘uuid’ are not available for package ‘ggiraph’
* removing ‘/Users/USER/Anaconda3/anaconda3/lib/R/library/ggiraph’
Warning in install.packages :
installation of package ‘ggiraph’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/fy/d14lc6rd5nq827m06zkkb1_h0000gn/T/RtmpKdtLil/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
If I try to install it from Terminal I get:
conda install -c conda-forge r-ggiraph
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
Examining backports.functools_lru_cache: 14%|▏| 87/641 [00:00<00:00, 1400.70it/
Examining bcrypt: 14%|███ | 88/641 [00:00<00:00, 1403.40it/s]
Examining sphinxcontrib-serializinghtml: 17%|▏| 106/641 [00:00<00:00, 1307.92it
Examining nss: 17%|████ | 107/641 [00:00<00:00, 1310.62it/s]
Examining clangdev: 22%|████▎ | 144/641 [00:00<00:00, 1233.48it/s]
/ mparing specs that have this dependenc-...**
... and the list of conflicts goes on and on and on...
Any ideas?
I am trying to install the S3 package on R inorder to save csv output on regressions I am running. I tried to install the S3 package to link the Rstudio server to S3 but with no luck. This is the error I recieved when trying to install the aws.s3 package:
> install.packages("aws.s3", repos = c("cloudyr" = "http://cloudyr.github.io/drat"))
Installing package into ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘httr’ is not available
trying URL 'http://cloudyr.github.io/drat/src/contrib/aws.s3_0.3.20.tar.gz'
Content type 'application/gzip' length 47438 bytes (46 KB)
==================================================
downloaded 46 KB
ERROR: dependency ‘httr’ is not available for package ‘aws.s3’
* removing ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4/aws.s3’
Warning in install.packages :
installation of package ‘aws.s3’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpxNVUj5/downloaded_packages’
I then tried installing the httr depence package but with no success as well.
> install.packages("httr")
Installing package into ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘openssl’
trying URL 'https://cran.rstudio.com/src/contrib/openssl_1.3.tar.gz'
Content type 'application/x-gzip' length 1218896 bytes (1.2 MB)
==================================================
downloaded 1.2 MB
trying URL 'https://cran.rstudio.com/src/contrib/httr_1.4.0.tar.gz'
Content type 'application/x-gzip' length 156356 bytes (152 KB)
==================================================
downloaded 152 KB
* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
Using PKG_CFLAGS=
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because openssl was not found. Try installing:
* deb: libssl-dev (Debian, Ubuntu, etc)
* rpm: openssl-devel (Fedora, CentOS, RHEL)
* csw: libssl_dev (Solaris)
* brew: openssl#1.1 (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘openssl’
* removing ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4/openssl’
Warning in install.packages :
installation of package ‘openssl’ had non-zero exit status
ERROR: dependency ‘openssl’ is not available for package ‘httr’
* removing ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4/httr’
Warning in install.packages :
installation of package ‘httr’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpxNVUj5/downloaded_packages’
Likewise when installing the openssl package. My EC2 instance type is a t2.medium.
Here, both some OS and some R dependencies are needed before installing the aws.s3 package of cloudyr.
aws.s3 depends on three R packages: curl, httr and xml. These depend, in turn, on the libssl, libxml2 and libcurl4-openssl OS libraries.
On a fresh new EC2 instance, assuming a Ubuntu box (but of course there are the equivalent yum packages for Fedora/CentOS/RedHat distros), OS dependences have to be installed for first:
sudo apt-get install -y build-essential libssl-dev libxml2-dev libcurl4-openssl-dev
Then you can install the following R packages, in the specified order:
install.packages('curl')
install.packages('httr')
install.packages('xml2')
install.packages("aws.s3", repos = c("cloudyr" = "http://cloudyr.github.io/drat"))
Hope this helps
I am trying to install twitteR package in Rstudio from the console using install.packages("twitteR") but it always fails.[the OS I am using is ubuntu]
Below are the messages shown after I give the command:
>install.packages("twitteR")
Installing package into ‘/home/siddhinath/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘curl’, ‘httr’
trying URL 'https://cloud.r-project.org/src/contrib/curl_3.3.tar.gz'
Content type 'application/x-gzip' length 371740 bytes (363 KB)
==================================================
downloaded 363 KB
trying URL 'https://cloud.r-project.org/src/contrib/httr_1.4.0.tar.gz'
Content type 'application/x-gzip' length 156356 bytes (152 KB)
==================================================
downloaded 152 KB
trying URL 'https://cloud.r-project.org/src/contrib/twitteR_1.1.9.tar.gz'
Content type 'application/x-gzip' length 215838 bytes (210 KB)
==================================================
downloaded 210 KB
* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
* deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
* rpm: libcurl-devel (Fedora, CentOS, RHEL)
* csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘curl’
* removing ‘/home/siddhinath/R/x86_64-pc-linux-gnu-library/3.4/curl’
Warning in install.packages :
installation of package ‘curl’ had non-zero exit status
ERROR: dependency ‘curl’ is not available for package ‘httr’
* removing ‘/home/siddhinath/R/x86_64-pc-linux-gnu-library/3.4/httr’
Warning in install.packages :
installation of package ‘httr’ had non-zero exit status
ERROR: dependency ‘httr’ is not available for package ‘twitteR’
* removing ‘/home/siddhinath/R/x86_64-pc-linux-gnu-library/3.4/twitteR’
Warning in install.packages :
installation of package ‘twitteR’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp8rLTd9/downloaded_packages’
Run this Linux command.
apt-get install libcurl4-openssl-dev
Trying to install R package ggiraph on my Mac OS X I ran into a problem with dependency xml2.
This seems to be a fairly common problem for users of this and other packages so after reading threads here and elsewhere I confirmed the following:
RStudio, R, and all its packages are up do date
libxml2 is installed in developer version, using homebrew
I have copied libxml-2.0.pc from homebrew folder to /usr/local/lib/pkgconfig/
I have added /usr/local/lib/pkgconfig/ to PATH and PKG_CONFIG_PATH
I still get the below error message during installation. Thankful for help!
> install.packages("ggiraph")
Installing package into ‘/usr/local/lib/R/3.5/site-library’
(as ‘lib’ is unspecified)
also installing the dependency ‘xml2’
trying URL 'https://cran.rstudio.com/src/contrib/xml2_1.2.0.tar.gz'
Content type 'application/x-gzip' length 251614 bytes (245 KB)
==================================================
downloaded 245 KB
trying URL 'https://cran.rstudio.com/src/contrib/ggiraph_0.6.0.tar.gz'
Content type 'application/x-gzip' length 208710 bytes (203 KB)
==================================================
downloaded 203 KB
* installing *source* package ‘xml2’ ...
** package ‘xml2’ successfully unpacked and MD5 sums checked
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/libxml2
Using PKG_LIBS=-L/usr/lib -lxml2 -lz -lpthread -licucore -lm
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libxml-2.0 was not found. Try installing:
* deb: libxml2-dev (Debian, Ubuntu, etc)
* rpm: libxml2-devel (Fedora, CentOS, RHEL)
* csw: libxml2_dev (Solaris)
If libxml-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libxml-2.0.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘xml2’
* removing ‘/usr/local/lib/R/3.5/site-library/xml2’
Warning in install.packages :
installation of package ‘xml2’ had non-zero exit status
ERROR: dependency ‘xml2’ is not available for package ‘ggiraph’
* removing ‘/usr/local/lib/R/3.5/site-library/ggiraph’
Warning in install.packages :
installation of package ‘ggiraph’ had non-zero exit status
This is a recurrent problem I have on macOS with Homebrew and libxml2. The includes of libxml2 are located in a subdirectory /path/to/includes/libxml2/libxml/ which can't be found by compilers.
I successfully installed xml2 in R doing two things:
Create symlink [...]/include/libxml pointing to [...]/include/libxml2/libxml
Add the include folder path to INCLUDE_DIR
Do point 1 in a terminal. Although filepath may be different on your installation, the shell command on my mac was:
Bash > ln -s /usr/local/Cellar/libxml2/2.9.9_2/include/libxml2/libxml /usr/local/Cellar/libxml2/2.9.9_2/include/libxml`
Do point 2 in RStudio's R Terminal. The command on my mac was:
R > Sys.setenv(INCLUDE_DIR = paste("/usr/local/Cellar/libxml2/2.9.9_2/include", Sys.getenv("INCLUDE_DIR"), sep = ":"))`
Then install xml2 and ultimately ggiraph:
R > install.packages(c("xml2", "ggiraph"))