简体   繁体   English

Haskell cabal-install错误

[英]Haskell cabal-install errors

I am having lots of problems with cabal-install : 我在cabal-install时遇到很多问题:
1: Every time I do cabal update , it tells me to do cabal install cabal-install , so I do, and then when I do cabal update again, it says the same thing. 1:每次我做cabal update ,它告诉我做cabal install cabal-install ,所以我这样做,然后当我再次进行cabal update时,它说同样的事情。

2: When I try to install ghc-mod from hackage, it gives me this error: 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.

So the problem was The program happy version >=1.17 is required but it could not be found. 所以问题是The program happy version >=1.17 is required but it could not be found. , so I installed happy 1.19.2 using cabal install happy without problems. ,所以我安装happy 1.19.2使用cabal install happy没有问题。

I tried cabal install ghc-mod again, same error, so I tried cabal install haskell-src-exts --reinstall --force-reinstalls . 我再次尝试cabal install ghc-mod ,同样的错误,所以我尝试了cabal install haskell-src-exts --reinstall --force-reinstalls It gave me the following error: 它给了我以下错误:

[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

Basically The program happy version >=1.17 is required but it could not be found. 基本上The program happy version >=1.17 is required but it could not be found. . So happy is the problem again? 那么问题又开心了吗?

I have also tried downloading the tar.gz files from hackage and using cabal install on the .cabal file, also modified the .cabal file to ignore dependencies, still failed. 我也尝试从hackage下载tar.gz文件并在.cabal文件上使用cabal install ,也修改.cabal文件以忽略依赖项,但仍然失败。

cabal install places executables in ~/.cabal/bin . cabal install~/.cabal/bin放置可执行文件。

If you add it to your path, you will be able to use the new executables installed by cabal: 如果将其添加到路径中,您将能够使用cabal安装的新可执行文件:

$ PATH=$HOME/.cabal/bin:$PATH

I encountered with same problem and I solved the problem with installing happy package(confusing package name). 我遇到了同样的问题,我解决了安装happy包(令人困惑的包名称)的问题。 So install it with your package manager(apt-get, pacman etc) before install package with cabal. 因此,在使用cabal安装软件包之前,请使用软件包管理器(apt-get,pacman等)进行安装。 This should be fix the problem. 这应该是解决问题的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM