23

我有很多问题cabal-install
1:每次我做cabal update,它告诉我做cabal install cabal-install,所以我做,然后当我cabal update再次做时,它说同样的话。

2:当我尝试ghc-mod从hackage安装时,它给了我这个错误:

[username@arch ~]$ cabal install ghc-mod
In order, the following will be installed:
haskell-src-exts-1.14.0 (reinstall) changes: pretty-1.1.1.1 -> 1.1.1.0
hlint-1.8.55 (reinstall)
ghc-mod-3.1.4
setup: The program happy version >=1.17 is required but it could not be found.
ghc-mod-3.1.4 depends on haskell-src-exts-1.14.0 which failed to install.
haskell-src-exts-1.14.0 failed during the configure step.
hlint-1.8.55 depends on haskell-src-exts-1.14.0 which failed to install.

所以问题是The program happy version >=1.17 is required but it could not be found.,所以我安装happy 1.19.2使用cabal install happy没有问题。

我又试cabal install ghc-mod了一次,同样的错误,所以我试了cabal install haskell-src-exts --reinstall --force-reinstalls。它给了我以下错误:

[username@arch ~]$ cabal install haskell-src-exts --reinstall --force-reinstalls
Configuring haskell-src-exts-1.14.0...
setup: The program happy version >=1.17 is required but it could not be found.
Failed to install haskell-src-exts-1.14.0
cabal: Error: some packages failed to install:
haskell-src-exts-1.14.0 failed during the configure step. The exception was:
ExitFailure 1

基本上The program happy version >=1.17 is required but it could not be found.。这么开心又出问题了?

我还尝试从hackage下载tar.gz文件并cabal install.cabal文件上使用,还修改了.cabal文件以忽略依赖项,仍然失败。

4

2 回答 2

30

cabal install将可执行文件放在~/.cabal/bin.

如果将其添加到路径中,您将能够使用 cabal 安装的新可执行文件:

$ PATH=$HOME/.cabal/bin:$PATH
于 2013-12-08T23:52:02.520 回答
23

我遇到了同样的问题,我解决了安装happy包的问题(混淆包名)。因此,在使用 cabal 安装包之前,请使用包管理器(apt-get、pacman 等)安装它。这应该可以解决问题。

于 2014-04-05T17:58:56.443 回答