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

强颜欢笑 提交于 2020-01-04 12:56:10

问题


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?


回答1:


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




回答2:


You need to install the readline-package with

cabal install readline



回答3:


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?



来源:https://stackoverflow.com/questions/5604715/could-not-find-module-system-console-readline-in-haskell

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!