Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when executing "cabal install hoogle"

Tags:

haskell

ghc

cabal

When I run cabal install hoogle, I get the following:

setup: The program happy version >=1.17 is required but it could not be found
cabal: Error: some packages failed to install
haskell-src-exts-1.13.3 failed during the configure step the exeption is ExitFailure 1

$ghc -V
The Glorious Glasgow Haskell Compilation System, version 7.4.1

How to fix such a problem?

like image 871
z_axis Avatar asked Sep 26 '26 08:09

z_axis


2 Answers

Instead of cabal install hoogle, run cabal install alex happy && cabal install hoogle.

Many packages on hackage require alex and happy, so it is good idea to install them after cabal update.

like image 145
permeakra Avatar answered Sep 28 '26 21:09

permeakra


I had lot's of trouble installing hoogle locally. Adding the cabal binary directory, ~/.cabal/bin to my PATH with

export PATH=$PATH:~/.cabal/bin

ended up essentially fixing my problem. After that, just follow the errors and install anything that cabal barks about missing, including alex and happy.

like image 36
RussellStewart Avatar answered Sep 28 '26 22:09

RussellStewart



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!