ubuntu - WSL : Cabal could not resolve dependencies. 容器,二进制

标签 ubuntu haskell windows-subsystem-for-linux cabal haskell-platform

我对使用haskell 和cabal 很陌生,我正在尝试使用cabal install --lib plot 安装包haskell package plot。我明白了

Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: binary-0.8.8.0/installed-0.8.8.0 (user goal)
[__1] next goal: containers (user goal)
[__1] rejecting: containers-0.6.4.1 (conflict: binary =>
containers==0.6.2.1/installed-0.6.2.1)
[__1] rejecting: containers-0.6.3.1, containers-0.6.2.1/installed-0.6.2.1,
containers-0.6.2.1, containers-0.6.1.1, containers-0.6.0.1,
containers-0.5.11.0, containers-0.5.10.2, containers-0.5.10.1,
containers-0.5.9.2, containers-0.5.8.2, containers-0.5.7.1,
containers-0.5.7.0, containers-0.5.6.3, containers-0.5.6.2,
containers-0.5.6.1, containers-0.5.6.0, containers-0.5.5.1,
containers-0.5.5.0, containers-0.5.4.0, containers-0.5.3.1,
containers-0.5.3.0, containers-0.5.2.1, containers-0.5.2.0,
containers-0.5.1.0, containers-0.5.0.0, containers-0.4.2.1,
containers-0.4.2.0, containers-0.4.1.0, containers-0.4.0.0,
containers-0.3.0.0, containers-0.2.0.1, containers-0.2.0.0,
containers-0.1.0.1, containers-0.1.0.0, containers-0.5.9.1, containers-0.5.8.1
(constraint from user target requires ==0.6.4.1)
[__1] fail (backjumping, conflict set: binary, containers)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: binary, containers, ghc
我尝试分别安装容器和二进制文件,但我得到了类似的错误。

最佳答案

当您使用 cabal install --lib 时会发生这种情况不了解它的确切作用。简而言之,它不适合拥有不断更新的全局库集。真的只能用一次。要再次使用它,您必须删除它创建的环境文件并将其与您希望在单个 cabal 中可用的库的完整列表一起使用。调用。老实说,这很痛苦,而且在几乎所有情况下,使用 cabal 文件都是一种更好的工作方式。
创建一个新目录,运行cabal init在其中,将所需的包添加到生成的 cabal 文件中,将代码放入生成的 Main.hs 中,用 cabal repl 进行实验, 运行 cabal exec .它不必比这更复杂,并且您可以通过相互独立地固定包版本来避免给自己带来额外的问题。

关于ubuntu - WSL : Cabal could not resolve dependencies. 容器,二进制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66825800/

相关文章:

c - 奇怪的右移位不一致

ubuntu - 如何创建 crontab 作业以在服务器重启时启动 Monero 矿工?

mysql - 这个 bash 脚本(cron + mysql)有什么问题

haskell - 没有因使用 `/' 而产生的 (Fractional Int) 实例

haskell - 将提升函数应用于 Haskell 中的元组(任意长度)

haskell - 按自定义字段对 Hakyll 项目列表进行排序

virtualization - WSL2 技术堆栈中讨论的 "lightweight vm"是什么意思?

windows-subsystem-for-linux - 在目录中打开 wsltty

bash - 使用 sed/awk 将 x^2 添加到每个 "nonzero"系数

windows-subsystem-for-linux - WSL 停止工作并出现错误 : 0x80070003