簡體   English   中英

haskell cabal sandbox如何安裝軟件包?

[英]haskell cabal sandbox how to install packages?

我希望有人告訴我在沙箱中安裝gloss-examples及其所有依賴項所需的步驟。 這是我嘗試做的事情:

我從hackage下載了loss gloss-examples軟件包。

當我運行命令時,更改為~/gloss/gloss-examples-1.9.4.1

~/gloss/gloss-examples-1.9.4.1$cabal sandbox init

成功了,所以我發出了命令

~/gloss/gloss-examples-1.9.4.1$cabal install --only-dependencies

但隨后出現以下錯誤:

Resolving dependencies...
cabal: Could not resolve dependencies:
trying: gloss-examples-1.9.4.1 (user goal)
next goal: base (dependency of gloss-examples-1.9.4.1)
rejecting: base-4.5.0.0/installed-c8e... (conflict: gloss-examples =>
base==4.8.*)
rejecting: base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1,
base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0,
base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2,
base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2,
base-3.0.3.1 (constraint from non-upgradeable package requires installed
instance)
Dependency tree exhaustively searched.

Note: when using a sandbox, all packages are required to have consistent
dependencies. Try reinstalling/unregistering the offending packages or
recreating the sandbox.

如何僅在沙盒目錄中安裝此程序包gloss-examples及其所有依賴項? 我想我知道,cabal sandbox允許您安裝任何軟件包,並將所有依賴項(某些或全部與全局安裝的軟件包沖突)安裝在單獨的目錄中。 這有可能嗎? 我想我缺少了一些東西。 這是陰謀沙箱的正確用例嗎? 看到以下

Note: when using a sandbox, all packages are required to have consistent dependencies.

conflicting dependenciesnot consistent dependencies之間有區別嗎?

我試過很多教程,包括但不明白怎么用陰謀沙箱。

在我看來,您下載的gloss-examples版本與您的base庫版本不兼容。 有兩種方法可以解決此問題:

  1. 下載與您的base庫兼容的版本(可能是較舊的版本)。 Hackage的軟件包的內容頁面頂部附近有一長串可用版本。 不確定,也可以使用cabal fetch來做到這一點。

  2. 升級GHC以獲得更新的base 通常,如果不升級GHC,就無法升級base

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM