cabal-install
我遇到很多问题:
1:每次我cabal update
时,它会告诉我cabal install cabal-install
,所以我这样做,然后当我再次cabal update
时,它会说同样的事情。
2:当我尝试从hackage安装ghc-mod
时,它给了我这个错误:
[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
文件以忽略依赖关系,但仍然失败。
答案 0 :(得分:30)
cabal install
将可执行文件放在~/.cabal/bin
。
如果将其添加到路径中,您将能够使用cabal安装的新可执行文件:
$ PATH=$HOME/.cabal/bin:$PATH
答案 1 :(得分:22)
我遇到了同样的问题,我解决了安装happy
包的问题(令人困惑的包名)。因此,在使用cabal安装软件包之前,请使用软件包管理器(apt-get,pacman等)进行安装。这应该可以解决问题。