我正在尝试将Posgres和cabal沙箱用于一个新项目。我已经安装了postgresql-simple,从安装输出可以看出:
$ cabal install postgresql-simple
Resolving dependencies...
All the requested packages are already installed:
postgresql-simple-0.4.10.0
Use --reinstall if you want to reinstall anyway.
Notice: installing into a sandbox located at
/Users/inaimathi/projects/hs-test/.cabal-sandbox但是,当我试图导入ghci中的库时,我会得到错误
ghci
GHCi, version 7.10.1: http://www.haskell.org/ghc/ :? for help
Prelude> import Database.PostgreSQL.Simple
import Database.PostgreSQL.Simple
<no location info>:
Could not find module ‘Database.PostgreSQL.Simple’
It is not a module in the current program, or in any known package.
Prelude> 有人能指出我做错了什么吗?
发布于 2015-07-04 13:29:56
您需要使用指向GHCi的-package-db=...标志启动/Users/inaimathi/projects/hs-test/.cabal-sandbox
所以ghci -package-db=/Users/inaimathi/projects/hs-test/.cabal-sandbox或附近..。
https://stackoverflow.com/questions/31220908
复制相似问题