我正在尝试将akka-http
导入我的Scala项目。我使用IntelliJ作为IDE。以下是我的build.sbt
:
import sbt._
name := "hello"
version := "1.0"
scalaVersion := "2.12.1"
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-http-experimental" % "1.0",
"com.typesafe.akka" %% "akka-http-spray-json-experimental" % "1.0",
"com.typesafe.akka" %%"akka-http-testkit-experimental" % "1.0",
"org.scalatest" %% "scalatest" % "2.2.5" % "test"
)
这是我遇到的错误:
Error:Error while importing SBT project:<br/>...<br/><pre>[info] Resolving org.scala-sbt.ivy#ivy;2.3.0-sbt-48dd0744422128446aee9ac31aa356ee203cc9f4 ...
[info] Resolving org.scala-sbt#test-interface;1.0 ...
[info] Resolving com.jcraft#jsch;0.1.50 ...
[info] Resolving org.scala-lang#scala-compiler;2.10.6 ...
[info] Resolving jline#jline;2.14.3 ...
[info] Resolving org.scala-sbt#compiler-ivy-integration;0.13.15 ...
[info] Resolving org.scala-sbt#incremental-compiler;0.13.15 ...
[info] Resolving org.scala-sbt#logic;0.13.15 ...
[info] Resolving org.scala-sbt#main-settings;0.13.15 ...
[trace] Stack trace suppressed: run 'last *:ssExtractDependencies' for the full output.
[trace] Stack trace suppressed: run 'last *:update' for the full output.
[error] (*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: com.typesafe.akka#akka-http-experimental_2.12;1.0: not found
[error] unresolved dependency: com.typesafe.akka#akka-http-spray-json-experimental_2.12;1.0: not found
[error] unresolved dependency: com.typesafe.akka#akka-http-testkit-experimental_2.12;1.0: not found
[error] unresolved dependency: org.scalatest#scalatest_2.12;2.2.5: not found
[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.akka#akka-http-experimental_2.12;1.0: not found
[error] unresolved dependency: com.typesafe.akka#akka-http-spray-json-experimental_2.12;1.0: not found
[error] unresolved dependency: com.typesafe.akka#akka-http-testkit-experimental_2.12;1.0: not found
[error] unresolved dependency: org.scalatest#scalatest_2.12;2.2.5: not found
[error] Total time: 6 s, completed Jul 13, 2017 6:14:02 PM</pre><br/>See complete log in <a href="file:/home/invictus/.IdeaIC2017.1/system/log/sbt.last.log">file:/home/invictus/.IdeaIC2017.1/system/log/sbt.last.log
答案 0 :(得分:2)
看起来这些库似乎不适用于Scala 2.12:
答案 1 :(得分:0)
您正在使用这些库的过时版本。 Akka HTTP不再是实验性的,在撰写本文时,最新版本为10.0.9。更新您的read_err_cnt
:
err_cnt = {'read': 0}
def clean_words(text):
tokenizer = RegexpTokenizer('[\'а-яА-Яёй]+', discard_empty=True)
try:
for word in tokenizer.tokenize(text):
yield word
except:
err_cnt['read'] += 1 # this assigns to the global "err_cnt" dictionary.
请注意,对于ScalaTest,如果您使用的是Scala 2.12,则必须升级到3.x。