【问题标题】:clojure - leiningen could not find deeplearning4j artifact via mavenclojure - leiningen 无法通过 maven 找到 deeplearning4j 工件
【发布时间】:2021-07-23 22:04:20
【问题描述】:

我正在尝试在我的 clojure/leiningen 学习过程中迈出下一步。

我想在我的 clojure 项目中导入 deeplearning4j。做一些研究,似乎可以通过 maven 用 leiningen 来做。根据tutorial,maven库来自here

我希望工作的过程是查找库(在本例中为 deeplearning4j)并将其添加到 project.clj 中:

(defproject to-remove "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
            :url "https://www.eclipse.org/legal/epl-2.0/"}
  :dependencies [[org.clojure/clojure "1.10.1"]
                 [org.deeplearning4j/deeplearning4j "1.0.0-beta7"]]
  :main ^:skip-aot to-remove.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all
                       :jvm-opts ["-Dclojure.compiler.direct-linking=true"]}})

但我得到了错误:

Could not find artifact org.deeplearning4j:deeplearning4j:jar:1.0.0-beta7 in central (https://repo1.maven.org/maven2/)
Could not find artifact org.deeplearning4j:deeplearning4j:jar:1.0.0-beta7 in clojars (https://repo.clojars.org/)
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.

我尝试添加:repositories 键,但也没有运气:

(defproject to-remove "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
            :url "https://www.eclipse.org/legal/epl-2.0/"}
  :dependencies [[org.clojure/clojure "1.10.1"]
                 [org.deeplearning4j/deeplearning4j "1.0.0-beta7"]]
  :main ^:skip-aot to-remove.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all
                       :jvm-opts ["-Dclojure.compiler.direct-linking=true"]}}
  :repositories [["maven-org" "https://search.maven.org/"]
                 ["maven-source" "https://mvnrepository.com/"]])

告诉我错误:

Retrieving org/deeplearning4j/deeplearning4j/1.0.0-beta7/deeplearning4j-1.0.0-beta7.jar from maven-org
Retrieving org/deeplearning4j/deeplearning4j/1.0.0-beta7/deeplearning4j-1.0.0-beta7.jar from maven-org
Apr 30, 2021 11:41:12 AM org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: MVN_SESSION=eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVpZCI6IjFjMTU0ZTQxLWE5YzItMTFlYi1hOTA5LTBiOWZkMzcxZjc1ZiJ9LCJleHAiOjE2NTEzMjk2NzIsIm5iZiI6MTYxOTc5MzY3MiwiaWF0IjoxNjE5NzkzNjcyfQ.onpYZCJmVMQt6ue-orMHPFCR6XxJb896QwbpMylElf4; Max-Age=31536000; Expires=Sat, 30 Apr 2022 14:41:12 GMT; SameSite=Lax; Path=/; HTTPOnly". Invalid 'expires' attribute: Sat, 30 Apr 2022
14:41:12 GMT
Could not find artifact org.deeplearning4j:deeplearning4j:jar:1.0.0-beta7 in central (https://repo1.maven.org/maven2/)
Could not find artifact org.deeplearning4j:deeplearning4j:jar:1.0.0-beta7 in clojars (https://repo.clojars.org/)
Could not transfer artifact org.deeplearning4j:deeplearning4j:jar:1.0.0-beta7 from/to maven-org (https://search.maven.org/): Checksum
validation failed, expected <!-- but is 6316efb328e43503f4e6869fa876dc6eb0e7a39b
Could not find artifact org.deeplearning4j:deeplearning4j:jar:1.0.0-beta7 in maven-source (https://mvnrepository.com/)
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.

谁能帮我理解我做错了什么?

谢谢!

【问题讨论】:

    标签: java maven clojure leiningen


    【解决方案1】:

    在您的 project.clj 中,使用 id org.deeplearning4j/deeplearning4j-core,而不是 org.deeplearning4j/deeplearning4j。您可能需要查看此information on Deeplearning4J dependencies,因为您可能需要其他一些内容。

    【讨论】:

    • 有趣。 lein deps 使用了您的建议。谢谢!你知道为什么 maven repo 中有一个 org.deeplearning4j/deeplearning4j 但不能通过 clojure “导入”吗?
    • Maven 工件 org.deeplearning4j:deeplearning4j 被其他项目作为父 POM 导入,除了构建配置之外没有任何实际内容。 Deeplearning4j 分为几个共享该配置的项目。作为 Deeplearning4j 的用户,您只需要依赖所需的项目。
    猜你喜欢
    • 1970-01-01
    • 2021-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多