【问题标题】:Trouble installing hstats library from hackage using cabal使用 cabal 从 hackage 安装 hstats 库时遇到问题
【发布时间】:2014-02-27 22:14:25
【问题描述】:
当我尝试安装 hstats 包时
$ cabal install hstats
我收到以下错误:
src/Math/Statistics.hs:1:1:
Ambiguous module name `Prelude':
it was found in multiple packages: base haskell98-2.0.0.2
Failed to install hstats-0.3
cabal: Error: some packages failed to install:
hstats-0.3 failed during the building phase. The exception was:
ExitFailure 1
我该如何解决这个问题?
【问题讨论】:
标签:
haskell
cabal
hackage
【解决方案1】:
hstats 取决于base >= 2.0 和 haskell98。当前版本的base 包含Prelude 模块,它是haskell98 的一部分,当时base 仍在版本2.x 中,但Prelude 现在是基础包的一部分。
您需要自行解压hstats 并修复错误。基本上,交换
build-depends: base>=2.0, haskell98
与
build-depends: base>=4.0
在 hstats.cabal 中:
$ cabal unpack hstats
$ cd hstats-0.3
$ vim hstats.cabal
$ cabal install .