开发者

Could not find module 'System.Console.Readline' in Haskell

开发者 https://www.devze.com 2023-02-23 10:09 出处:网络
When I try to execute :load hello.hs in ghci, I get the following error: Could not find module \"System.Console.Readline\"

When I try to execute :load hello.hs in ghci, I get the following error:

Could not find module "System.Console.Readline"

Since this is a System module, I thought this would work. How do开发者_运维百科 I fix this?


You need to install the readline-package with

cabal install readline


When you want to use brew for deadline on Mac OS X.

  1. Install readline: brew install readline
  2. cabal install readline --extra-include-dirs=/usr/local/Cellar/readline/6.3.8/include/ --extra-lib-dirs=/usr/local/Cellar/readline/6.3.8/lib/ --configure-option=--with-readline-includes=/usr/local/Cellar/readline/6.3.8/inc‌​lude/ --configure-option=--with-readline-libraries=/usr/local/Cellar/readline/6.3.8/lib/

Reference: How do you install the haskell readline library on Mac OSX?


Depending on your system, you will want to install the readline Haskell package.

To do so, make sure that you have GNU readline actually installed via apt-get (Ubuntu), macports (Mac OSX), Cygwin (Windows?), or whatever your favourite package manager is on your platform.

If you have Haskell's cabal installed, simply run cabal install readline and hopefully everything will compile, and you can try and run your hello.hs again!

If you don't have cabal, it's a sort of command line interface for grabbing and managing packages from HackageDB. Follow the instructions on haskell.org/cabal to get cabal. It's pretty handy to have, if not essential :D

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号