Unable to launch SparkR in RStudio

前端 未结 7 985
一向
一向 2021-02-19 07:52

After long and difficult installation process of SparkR i getting into new problems of launching SparkR.

My Settings

R 3.2.0    
RStudio 0.98.1103    
Rt         


        
7条回答
  •  执笔经年
    2021-02-19 08:43

    I had exact same issue. I can start SparkR in command line, but not in RStudio in Windows. And here is the solution works for me.

    1. clean up all the paths you set when you tried to fix this issue. This including the paths you set in the windows environment from window control panel and uses Sys.unsetenv() to unset the SPARK_HOME.

    2. find out your RStudio default working directory by using getwd() in RStudio. And then create a .Rprofile file in this directory. Put the following line in this file: .libPaths("C:/Apache/Spark-1.5.1/R/lib")

    3. In window control panel->System->Advanced system settings->Environment Variables, add this ";C:\Apache\Spark-1.5.1\bin" at the end of your exsiting PATH variable.

    4. Start RStudio, if you type .libPaths(), you can see the SparkR library path is already in the library path

    5. use library(SparkR) to load SparkR library

    6. sc=sparkR.init(master="local")

    I tried this on both Spark 1.4.1 and 1.5.1, they both work fine. I hope this can help whoever still having issue after all the suggestion above.

提交回复
热议问题