Haskell Could not find the module `Network.HTTP.Conduit '

I cannot get this import to work in haskell.

import Network.HTTP.Conduit 

When I try to compile, I get the following error:

 $ 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. 

The same error occurs if I try to upload a file to GHCI.

I installed the latest version of http-conduit via cabal. Here is the result from cabal:

 $ 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 

If that can make a difference, I'm using Ubuntu 12.04.

Any ideas why this will not be imported?

Edit: Listing from "ghc-pkg":

 $ 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 

And from the 'ghc-pkg check':

 $ 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 

After running "ghc-pkg unregister derive-2.5.11" and "ghc-pkg unregister peakachu-0.3.0, the warnings from the" ghc-pkg list http-conduit "no longer occur, but the problem persists.

From stderr 'ghc-pkg check':

 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 

Compilation output with '-package http-conduit':

 $ 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 -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 $ 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 -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- $ 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 

It looks like I have all the dependencies listed. Here is the result from the cabal list

 * asn1-data Synopsis: ASN1 data reader and writer in RAW, BER and DER forms Default available version: 0.7.1 Installed versions: 0.7.1 Homepage: http://github.com/vincenthz/hs-asn1-data License: BSD3 * attoparsec-conduit Synopsis: Consume attoparsec parsers via conduit. Default available version: 0.5.0.2 Installed versions: 0.5.0.1 Homepage: http://github.com/snoyberg/conduit License: BSD3 * blaze-builder-conduit Synopsis: Convert streams of builders to streams of bytestrings. Default available version: 0.5.0.1 Installed versions: 0.5.0.1 Homepage: http://github.com/snoyberg/conduit License: BSD3 * certificate Synopsis: Certificates and Key Reader/Writer Default available version: 1.3.1 Installed versions: 1.2.8, 1.3.1 Homepage: http://github.com/vincenthz/hs-certificate License: BSD3 * conduit Synopsis: Streaming data processing library. Default available version: 0.5.2.7 Installed versions: 0.5.2.4 Homepage: http://github.com/snoyberg/conduit License: BSD3 * failure Synopsis: A simple type class for success/failure computations. Default available version: 0.2.0.1 Installed versions: 0.2.0.1 Homepage: http://www.haskell.org/haskellwiki/Failure License: BSD3 * lifted-base Synopsis: lifted IO operations from the base library Default available version: 0.2 Installed versions: 0.1.2 Homepage: https://github.com/basvandijk/lifted-base License: BSD3 * monad-control Synopsis: Lift control operations, like exception catching, through monad transformers Default available version: 0.3.1.4 Installed versions: 0.3.1.4 Homepage: https://github.com/basvandijk/monad-control License: BSD3 * network Synopsis: Low-level networking interface Default available version: 2.4.0.1 Installed versions: 2.4.0.1 Homepage: https://github.com/haskell/network License: BSD3 * resourcet Synopsis: Deterministic allocation and freeing of scarce resources. Default available version: 0.4.0.2 Installed versions: 0.4.0.1 Homepage: http://github.com/snoyberg/conduit License: BSD3 * tls Synopsis: TLS/SSL protocol native implementation (Server and Client) Default available version: 1.0.1 Installed versions: 0.9.10, 1.0.1 Homepage: http://github.com/vincenthz/hs-tls License: BSD3 * tls-extra Synopsis: TLS extra default values and helpers Default available version: 0.5.0 Installed versions: 0.4.6, 0.4.6, 0.5.0, 0.5.0 Homepage: http://github.com/vincenthz/hs-tls License: BSD3 * transformers-base Synopsis: Lift computations from the bottom of a transformer stack Default available version: 0.4.1 Installed versions: 0.4.1 Homepage: https://github.com/mvv/transformers-base License: BSD3 * zlib-conduit Synopsis: Streaming compression/decompression via conduits. Default available version: 0.5.0.1 Installed versions: 0.5.0.1 Homepage: http://github.com/snoyberg/conduit License: BSD3 

This is the result from the "ghc-pkg xxxx" list, where xxxx is each of the packages in the dependency list that result from compilation with the "-package http-conduit" flag:

 /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: 
+6
source share
1 answer

I could not solve the problem directly. But I was able to "destroy" the installed packages and start a new one.

 rm -rf ~/.ghc/i386-linux-7.4.1 cabal install http-conduit 

After that, it worked fine. You will also have to reinstall all of your other packages.

+7
source

All Articles