gpt4 book ai didi

haskell - 安装 Happy 时出现问题

转载 作者:行者123 更新时间:2023-12-01 11:41:18 25 4
gpt4 key购买 nike

我正在尝试安装 Fay。 Fay 依赖于 pretty-show,所以我正在安装它。当我运行 cabal install pretty-show 时,出现以下错误:

Resolving dependencies...
Configuring pretty-show-1.6.2...
cabal: The program happy version >=1.19 is required but the version found at
/usr/bin/happy is version 1.18.10
Failed to install pretty-show-1.6.2
cabal: Error: some packages failed to install:
pretty-show-1.6.2 failed during the configure step. The exception was:
ExitFailure 1

当我尝试运行 cabal install happy 时,它说它成功了:

Resolving dependencies...
[1 of 1] Compiling Main ( /var/folders/d1/h6lvlvnd0j18lf3ml2rn11dm0000gq/T/happy-1.19.2-89313/happy-1.19.2/Setup.lhs, /var/folders/d1/h6lvlvnd0j18lf3ml2rn11dm0000gq/T/happy-1.19.2-89313/happy-1.19.2/dist/setup/Main.o )
Linking /var/folders/d1/h6lvlvnd0j18lf3ml2rn11dm0000gq/T/happy-1.19.2-89313/happy-1.19.2/dist/setup/setup ...
Configuring happy-1.19.2...
Building happy-1.19.2...
Preprocessing executable 'happy' for happy-1.19.2...
[ 1 of 18] Compiling NameSet ( src/NameSet.hs, dist/build/happy/happy-tmp/NameSet.o )
[ 2 of 18] Compiling Target ( src/Target.lhs, dist/build/happy/happy-tmp/Target.o )
[ 3 of 18] Compiling AbsSyn ( src/AbsSyn.lhs, dist/build/happy/happy-tmp/AbsSyn.o )
[ 4 of 18] Compiling ParamRules ( src/ParamRules.hs, dist/build/happy/happy-tmp/ParamRules.o )
[ 5 of 18] Compiling GenUtils ( src/GenUtils.lhs, dist/build/happy/happy-tmp/GenUtils.o )
[ 6 of 18] Compiling ParseMonad ( src/ParseMonad.lhs, dist/build/happy/happy-tmp/ParseMonad.o )
[ 7 of 18] Compiling Lexer ( src/Lexer.lhs, dist/build/happy/happy-tmp/Lexer.o )
[ 8 of 18] Compiling Parser ( dist/build/happy/happy-tmp/Parser.hs, dist/build/happy/happy-tmp/Parser.o )
[ 9 of 18] Compiling AttrGrammar ( src/AttrGrammar.lhs, dist/build/happy/happy-tmp/AttrGrammar.o )
[10 of 18] Compiling AttrGrammarParser ( dist/build/happy/happy-tmp/AttrGrammarParser.hs, dist/build/happy/happy-tmp/AttrGrammarParser.o )
[11 of 18] Compiling Grammar ( src/Grammar.lhs, dist/build/happy/happy-tmp/Grammar.o )
[12 of 18] Compiling First ( src/First.lhs, dist/build/happy/happy-tmp/First.o )
[13 of 18] Compiling LALR ( src/LALR.lhs, dist/build/happy/happy-tmp/LALR.o )
[14 of 18] Compiling Paths_happy ( dist/build/autogen/Paths_happy.hs, dist/build/happy/happy-tmp/Paths_happy.o )
[15 of 18] Compiling ProduceCode ( src/ProduceCode.lhs, dist/build/happy/happy-tmp/ProduceCode.o )
[16 of 18] Compiling ProduceGLRCode ( src/ProduceGLRCode.lhs, dist/build/happy/happy-tmp/ProduceGLRCode.o )
[17 of 18] Compiling Info ( src/Info.lhs, dist/build/happy/happy-tmp/Info.o )
[18 of 18] Compiling Main ( src/Main.lhs, dist/build/happy/happy-tmp/Main.o )
Linking dist/build/happy/happy ...
Warning: No documentation was generated as this package does not contain a
library. Perhaps you want to use the --executables flag.
Installing executable(s) in
/Users/buck2/Library/Haskell/ghc-7.6.3/lib/happy-1.19.2/bin
Installed happy-1.19.2
Updating documentation index /Users/buck2/Library/Haskell/doc/index.html

但是当我调用 cabal info happy 时,它会这样说,我认为这意味着它没有安装:

Bucks-MacBook-Pro:~ buck2$ cabal info happy
* happy (program)
Synopsis: Happy is a parser generator for Haskell
Versions available: 1.16, 1.17, 1.18.8, 1.18.9, 1.18.10, 1.18.11, 1.19.0,
1.19.1, 1.19.2 (and 7 others)
Versions installed: [ Unknown ]
Homepage: http://www.haskell.org/happy/
Bug reports: https://github.com/simonmar/happy/issues
Description: Happy is a parser generator for Haskell. Given a grammar
specification in BNF, Happy generates Haskell code to parse
the grammar. Happy works in a similar way to the @yacc@ tool
for C.
Category: Development
License: BSD3
Author: Andy Gill and Simon Marlow
Maintainer: Simon Marlow <marlowsd@gmail.com>
Source repo: http://github.com/simonmar/happy.git
Executables: happy
Flags: small_base
Dependencies: base >=1.0 && <2.1, containers -any, array -any, base >=2.1,
mtl >=1.0, base <5, process -any, base -any
Cached: Yes

知道为什么我会遇到这个问题吗?我正在运行 OS X Mavericks,我今天刚刚重新安装了 Haskell 平台。

最佳答案

我曾经遇到过这个问题,在我的情况下,这是一个版本问题....我有一个操作系统附带的 happy 版本(在/usr/bin/happy),但 cabal 版本在 ~/.cabal/bin/happy.

根据错误消息中的注释,这可能也是(很可能是?)您的问题。

检查您的 PATH 变量,看看它是否指向正确的 happy。

关于haskell - 安装 Happy 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20437122/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com