繁体   English   中英

PostgreSQL“找不到模块”

[英]PostgreSQL "Could not find module"

我正在尝试将 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> 

谁能指出我做错了什么?

您需要使用指向/Users/inaimathi/projects/hs-test/.cabal-sandbox -package-db=...标志启动 GHCi

所以ghci -package-db=/Users/inaimathi/projects/hs-test/.cabal-sandboxghci -package-db=/Users/inaimathi/projects/hs-test/.cabal-sandbox ...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM