Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Haskell找不到模块`Network.HTTP.conductor';_Http_Haskell_Networking_Https_Http Conduit - Fatal编程技术网

Haskell找不到模块`Network.HTTP.conductor';

Haskell找不到模块`Network.HTTP.conductor';,http,haskell,networking,https,http-conduit,Http,Haskell,Networking,Https,Http Conduit,我无法让这个导入在haskell中工作 import Network.HTTP.Conduit 当我尝试编译时,出现以下错误: $ ghc Play.hs Play.hs:1:8: Could not find module `Network.HTTP.Conduit' Use -v to see a list of the files searched for. 如果我尝试在GHCI中加载该文件,则会发生相同的错误 我已经通过cabal安装了最新版本的http导管。以下是

我无法让这个导入在haskell中工作

import Network.HTTP.Conduit
当我尝试编译时,出现以下错误:

$ ghc Play.hs

Play.hs:1:8:
    Could not find module `Network.HTTP.Conduit'
    Use -v to see a list of the files searched for.
如果我尝试在GHCI中加载该文件,则会发生相同的错误

我已经通过cabal安装了最新版本的http导管。以下是阴谋集团的输出:

$ cabal -list http-conduit
* http-conduit
    Synopsis: HTTP client package with conduit interface and HTTPS support.
    Default available version: 1.8.2
    Installed versions: 1.6.0.4, 1.8.2
    Homepage: http://www.yesodweb.com/book/http-conduit
    License:  BSD3

* http-conduit-browser
    Synopsis: Browser interface to the http-conduit package
    Default available version: 1.6.3
    Installed versions: 1.6.3
    Homepage: https://github.com/exbb2/http-conduit-browser
    License:  BSD3
如果可能会有所不同,我使用的是Ubuntu 12.04

你知道为什么这不重要吗

编辑: “ghc包装清单”的输出:

$ ghc-pkg list http-conduit
WARNING: there are broken packages.  Run 'ghc-pkg check' for more details.
/var/lib/ghc/package.conf.d
   http-conduit-1.6.0.4
   http-conduit-1.8.2
~/.ghc/i386-linux-7.4.1/package.conf.d
从“ghc包装检查”中:

$ ghc-pkg check
The following packages are broken, either because they have a problem
listed above, or because they depend on a broken package.
derive-2.5.11
derive-2.5.11
peakachu-0.3.0
peakachu-0.3.0
Warning: haddock-interfaces: /usr/local/share/doc/http-conduit-browser-1.6.3/html/http-conduit-browser.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/local/share/doc/http-conduit-browser-1.6.3/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/local/share/doc/http-conduit-1.8.2/html/http conduit.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/local/share/doc/http-conduit-1.8.2/html doesn't exist or isn't a directory
运行“ghc pkg注销派生-2.5.11”和“ghc pkg注销peakachu-0.3.0”后,“ghc pkg列表http导管”中的警告不再出现,但问题尚未解决

根据“ghc包装检查”标准:

$ ghc-pkg check
The following packages are broken, either because they have a problem
listed above, or because they depend on a broken package.
derive-2.5.11
derive-2.5.11
peakachu-0.3.0
peakachu-0.3.0
Warning: haddock-interfaces: /usr/local/share/doc/http-conduit-browser-1.6.3/html/http-conduit-browser.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/local/share/doc/http-conduit-browser-1.6.3/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/local/share/doc/http-conduit-1.8.2/html/http conduit.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/local/share/doc/http-conduit-1.8.2/html doesn't exist or isn't a directory
使用'-package http conductor'编译时的输出:

$ ghc -package http-conduit Play.hs -v
<command line>: cannot satisfy -package http-conduit: 
    http-conduit-1.8.2-13f7764675fbae0ac9de8bcf7925f78e is unusable due to missing or recursive dependencies:
      asn1-data-0.7.1-cb75ffc05237f33632b42d2fb76a7a29 attoparsec-conduit-0.5.0.1-5fe0cc7293ce100ae00db2d7e67f682f blaze-builder-conduit-0.5.0.1-59a72b475661fd25bd4619f58e8b40de certificate-1.3.1-dd3ba477e9b28bd6e4ab3d8865f22a87 conduit-0.5.2.4-88846c185b7e5037f242975916feb7e2 failure-0.2.0.1-49a74d2d91efe8118b3ce4233a86c2be lifted-base-0.1.2-1905d9349e322d5bbdfc585c7291efe4 monad-control-0.3.1.4-2629785f64d5c6eb4b6a72e854127870 network-2.4.0.1-53e0509d073f1b67ec3e641af74cb551 resourcet-0.4.0.1-07b5b503a019bd31b56feec9c26dfaec tls-1.0.1-f578324e807426668353637611a71070 tls-extra-0.5.0-459144227bb52a8255b4a149f58f3520 transformers-base-0.4.1-d27396afe6939ffd84456ceebf04bfbb zlib-conduit-0.5.0.1-f6b2f2e99cffe03ace3d731c20826f12
http-conduit-1.6.0.4-963a389e596e9c9f7c021dc97238cc52 is unusable due to missing or recursive dependencies:
  asn1-data-0.7.1-cb75ffc05237f33632b42d2fb76a7a29 attoparsec-conduit-0.5.0.1-5fe0cc7293ce100ae00db2d7e67f682f blaze-builder-conduit-0.5.0.1-59a72b475661fd25bd4619f58e8b40de certificate-1.2.8-78aa58c1d97c0315f599845cf7924ae2 conduit-0.5.2.4-88846c185b7e5037f242975916feb7e2 failure-0.2.0.1-49a74d2d91efe8118b3ce4233a86c2be lifted-base-0.1.2-1905d9349e322d5bbdfc585c7291efe4 monad-control-0.3.1.4-2629785f64d5c6eb4b6a72e854127870 network-2.4.0.1-53e0509d073f1b67ec3e641af74cb551 resourcet-0.4.0.1-07b5b503a019bd31b56feec9c26dfaec tls-0.9.10-bedda6ba89d62d8b86895a07b0d4437e tls-extra-0.4.6-e10848dbad24b59704ecb96d86e5362a transformers-base-0.4.1-d27396afe6939ffd84456ceebf04bfbb zlib-conduit-0.5.0.1-f6b2f2e99cffe03ace3d731c20826f12
这是“ghc pkg list xxxx”的输出,其中xxxx是使用“-package http conductor”标志编译产生的依赖项列表中的每个包:

/var/lib/ghc/package.conf.d:
asn1-data-0.7.1

~/.ghc/i386-linux-7.4.1/package.conf.d:

/var/lib/ghc/package.conf.d:
attoparsec-conduit-0.5.0.1

~/.ghc/i386-linux-7.4.1/package.conf.d:

/var/lib/ghc/package.conf.d:
blaze-builder-conduit-0.5.0.1

~/.ghc/i386-linux-7.4.1/package.conf.d:

/var/lib/ghc/package.conf.d:
certificate-1.2.8
certificate-1.3.1

~/.ghc/i386-linux-7.4.1/package.conf.d:

/var/lib/ghc/package.conf.d:
conduit-0.5.2.4

~/.ghc/i386-linux-7.4.1/package.conf.d:

/var/lib/ghc/package.conf.d:
failure-0.2.0.1

~/.ghc/i386-linux-7.4.1/package.conf.d:
failure-0.2.0.1

/var/lib/ghc/package.conf.d:
lifted-base-0.1.2

~/.ghc/i386-linux-7.4.1/package.conf.d:

/var/lib/ghc/package.conf.d:
monad-control-0.3.1.4

~/.ghc/i386-linux-7.4.1/package.conf.d:
monad-control-0.3.1.4

/var/lib/ghc/package.conf.d:
network-2.4.0.1

~/.ghc/i386-linux-7.4.1/package.conf.d:
network-2.4.0.1

/var/lib/ghc/package.conf.d:
resourcet-0.4.0.1

~/.ghc/i386-linux-7.4.1/package.conf.d:

/var/lib/ghc/package.conf.d:
tls-0.9.10
tls-1.0.1

~/.ghc/i386-linux-7.4.1/package.conf.d:

/var/lib/ghc/package.conf.d:
tls-extra-0.4.6
tls-extra-0.5.0

~/.ghc/i386-linux-7.4.1/package.conf.d:

/var/lib/ghc/package.conf.d:
transformers-base-0.4.1

~/.ghc/i386-linux-7.4.1/package.conf.d:
transformers-base-0.4.1

/var/lib/ghc/package.conf.d:
zlib-conduit-0.5.0.1

~/.ghc/i386-linux-7.4.1/package.conf.d:

我无法直接解决这个问题。但是,我能够“核”安装的软件包,重新开始

rm -rf ~/.ghc/i386-linux-7.4.1
cabal install http-conduit
在这之后,它工作得很好。您还必须重新安装所有其他软件包。

FWIW我使用了“cabal安装http导管” 然后我得到了以下提示:

Building     http-conduit-2.3.8 (lib)
Installing   http-conduit-2.3.8 (lib)
Completed    http-conduit-2.3.8 (lib)
Warning:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: Installation might not be completed as desired! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Without flags, the command "cabal install" doesn't expose libraries in a
usable manner. You might have wanted to run "cabal install --lib http-conduit".
然后我尝试加载我的文件,并在ghc中获得了以下内容:

Prelude> :l Main.hs
[1 of 1] Compiling Main             ( Main.hs, interpreted )

Main.hs:9:1: error:
    Could not load module ‘Network.HTTP.Conduit’
    It is a member of the hidden package ‘http-conduit-2.3.8’.
    You can run ‘:set -package http-conduit’ to expose it.
    (Note: this unloads all the modules in the current scope.)
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
9 | import Network.HTTP.Conduit (simpleHttp)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Failed, no modules loaded.

所以“cabal安装--lib http导管”解决了这个问题。

只是为了确保:您的GHC版本是7.x.y?如果是6.x.y,您需要
--make
标志,但我认为12.04没有ghc-6.*,是吗?我使用的是7.4.1版。这是安装在apt get install ghc上的版本。好的,不是这样的。ghc pkg list http conductor的输出是什么?啊,这似乎很有希望。我用outputHm更新了原来的帖子,你有两个示例,分别是
deriver-2.5.11
peakachu-0.3.0
,这不应该是。我希望全局数据库和用户数据库各有一个。如果尝试
ghc pkg注销peakachu-0.3.0--user
(类似于
deriver-2.5.11
),会发生什么情况?它是否警告说这会破坏无数其他软件包?我建议学习阴谋集团的沙盒——因为使用它们我几乎不必再使用我的
.ghc
目录了。