-1

I have created an EC2 instance in AWS(with Ubuntu), installed r studio server, but when I am trying to install the plotly package it gives an error related to OpenSSL:

------------------------- 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=...'
------------------------------------------------------------‌-------

Also, I have tried to install devtools but no luck. Please help as this is the only part where I am stuck?

Thanks!

MLavoie
  • 9,671
  • 41
  • 36
  • 56
Vish
  • 1
  • 1
  • Please post the exact error messages. Most likely you are missing some *-dev packages. – Ralf Stubner Jan 14 '18 at 15:06
  • ------------------------- 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=...' ------------------------------------------------------------------- – Vish Jan 14 '18 at 16:40

2 Answers2

0

As the error message tells you, you need to install (the development files for) libcurl:

sudo apt-get install libcurl4-openssl-dev

There might be more such error messages down the road.

An interesting alternative to manual installation is to use binary packages, since their dependencies are handled automatically. See http://dirk.eddelbuettel.com/blog/2017/12/22/#014_finding_binary_deb_packages for details.

Ralf Stubner
  • 26,263
  • 3
  • 40
  • 75
0

In Ubuntu 18.04 and later open the terminal and type:

sudo apt install r-cran-plotly   

In earlier Ubuntu releases than Ubuntu 18.04 plotly can be installed with the following commands:

sudo R -e "install.packages('ggplot2', repos = 'http://cran.us.r-project.org')"
sudo R -e "install.packages('plotly', repos = 'http://cran.us.r-project.org')"
karel
  • 5,489
  • 46
  • 45
  • 50