Cabal安装http-conduit-browser

时间:2014-12-13 11:28:23

标签: haskell cabal http-conduit

可能这是一场如此艰难的斗争,因为我在Windows上...我最近尝试使用Git Bash离开Cabal Hell:

$ rm -R ~/AppData/Roaming/ghc ~/AppData/Roaming/cabal
$ cabal update
$ cabal install cabal-install
$ cabal install http-conduit-browser

结果是:

Failed to install http-conduit-1.9.6
Last 10 lines of the build log ( C:\Users\T\AppData\Roaming\cabal\logs\http-conduit-1.9.6.log ):
        so you can specify the instance context yourself
    When deriving the instance for (Read Cookie)

Network\HTTP\Conduit\Types.hs:239:19:
    No instance for (Show UTCTime)
      arising from the third field of `Cookie' (type `UTCTime')
    Possible fix:
      use a standalone 'deriving instance' declaration,
        so you can specify the instance context yourself
    When deriving the instance for (Show Cookie)
cabal.exe: Error: some packages failed to install:
http-conduit-1.9.6 failed during the building phase. The exception was:
ExitFailure 1
http-conduit-browser-1.9.0.2 depends on http-conduit-1.9.6 which failed to
install.

尝试安装http-conduit工作正常,但我似乎无法安装http-conduit-browser。如果这不起作用,那么还有其他库吗?我还试过了shpider但由于curl库而无法正常工作。

1 个答案:

答案 0 :(得分:1)

http-conduit-browser (link)的github页面建议你使用wreq (link)

如果你想在这里使用http-conduit-browser,那就是建立http-conduit-1.9.6的技巧:

  1. cabal get http-conduit-1.9.6
  2. cd http-conduit-1.9.6
  3. 根据此SO答案修改Network / HTTP / Conduit / Types.hs:(link) [用导入Data.Time替换导入Data.Time.Clock]
  4. cabal install
  5. 现在你应该能够构建http-conduit-browser。