Suraj Patil
Suraj Patil

Reputation: 43

Install R package on SQL Server 2016

How to install a particular R package on SQL Server 2016.Package like 'ggplot2'.There is the command in R is 'Install.Packages("ggplot2")'.But how we can install this package on SQL Server 2016.

Upvotes: 0

Views: 535

Answers (1)

Kate
Kate

Reputation: 349

I kept getting errors regarding package management for SQL Server 2017 "Error: The package management feature is not enabled for the current user or not supported on SQL Server version 14".

What finally worked for me was to go to the R version installed with SQL, then install the R packages as I normally would through R, but for the System Library instead of the User Library:

install.packages("tidyverse", lib="C:\\Program Files\\Microsoft SQL Server\\MSSQL14.MSSQLSERVER\\R_SERVICES\\library")

You need to run R as admin to execute the code above, otherwise you will get an error that the folder is not writeable.

If you run in R the command:

.libPaths()

it will show you the user path and the system path. The packages you install normally forces them to go to the user path. I suspect SQL Server can't find it if it's in the user path.

Upvotes: 0

Related Questions