0

I have problem importing libraries

import play.api.libs.json._
import play.api.libs.functional.syntax._
[ERROR] [Console$] [error] /home/lavalamp/PredictionIO/algorithms/bestseller/src/main/scala/DataSource.scala:25: object api is not a member of package play
[ERROR] [Console$] [error] import play.api.libs.json._
[ERROR] [Console$] [error]             ^
[ERROR] [Console$] [error] /home/lavalamp/PredictionIO/algorithms/bestseller/src/main/scala/DataSource.scala:26: object api is not a member of package play
[ERROR] [Console$] [error] import play.api.libs.functional.syntax._

Could anyone help me with this?

Peter Neyens
  • 9,770
  • 27
  • 33
Le Kim Trang
  • 369
  • 2
  • 5
  • 17
  • I suppose "import play.api.libs. json._ import play.api.libs.functional.syntax._" are in different lines. Have you the play plugin in project/plugins.sbt? – David Oct 09 '15 at 10:48
  • PredictionIO uses json4s a lot for json parsing so it's already in the runtime artifact. You might take a look at that, I've used it before. – pferrel Oct 09 '15 at 18:58
  • Also you have to add either to the build.sbt for templates, what does your's have in it? – pferrel Oct 09 '15 at 19:47
  • Dear Pat, This is my build.sbt, import AssemblyKeys._ assemblySettings name := "predictionio-bestseller-algorithm" organization := "com.biglabs" parallelExecution in Test := false test in assembly := {} libraryDependencies ++= Seq( "io.prediction" %% "core" % pioVersion.value % "provided", "org.apache.spark" %% "spark-core" % "1.4.1" % "provided", "org.apache.spark" %% "spark-mllib" % "1.4.1" % "provided", "org.scalatest" %% "scalatest" % "2.2.1" % "test" ) – Le Kim Trang Oct 11 '15 at 11:10
  • Dear Pat, I already added "org.json4s" %% "json4s-native" % "3.3.0", thanks. – Le Kim Trang Oct 11 '15 at 11:43

0 Answers0