gpt4 book ai didi

scala - 如何在 Intellij 项目中使用 SBT libraryDependencies 安装库

转载 作者:行者123 更新时间:2023-12-04 13:52:02 24 4
gpt4 key购买 nike

我对 SBT、Breeze 和 IntelliJ 非常陌生,尽管我对 Scala 有很好的掌握,并且我正在尝试安装 Breeze 库,我认为它是受管理的。

我做了什么:

我按照 this page 上的说明进行操作并将此脚本添加到 build.sbt我的项目中的文件:

libraryDependencies  ++= Seq(
// other dependencies here
"org.scalanlp" %% "breeze" % "0.10",
// native libraries are not included by default. add this if you want them (as of 0.7)
// native libraries greatly improve performance, but increase jar sizes.
"org.scalanlp" %% "breeze-natives" % "0.10"
)

resolvers ++= Seq(
// other resolvers here
"Sonatype Releases" at "https://oss.sonatype.org/content/repositories/releases/"
)

// Scala 2.9.2 is still supported for 0.2.1, but is dropped afterwards.
scalaVersion := "2.11.1" // or 2.10.3 or later

然后我跑了 sbt update在项目目录中(通过终端),看到所有的微风片段都下载了。

然后我尝试重新运行 sbt update ,但这并没有触发另一个下载。

问题:

问题是我无法通过 IntelliJ 访问该库。 import breeze._给出标准 Cannot resolve symbol breeze我在“项目结构”中找不到任何提及微风的内容。它也不在项目的 lib 目录中。

我错过了一步吗?

最佳答案

听起来像是 IntelliJ 项目中的错误,请尝试删除 .idea目录,然后使用向导将项目重新导入 IntelliJ。

关于scala - 如何在 Intellij 项目中使用 SBT libraryDependencies 安装库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30377692/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com