[Nix-dev] More Library Trouble (Haskell and Python Libraries)

Bryan Gardiner bog at khumba.net
Tue Oct 20 23:13:55 CEST 2015


Hi Taeer,

For Haskell, you should read the "User's Guide to the Haskell
Infrastructure" at https://nixos.org/nixpkgs/manual, in particular
section 11.2.2 which explains why simply installing Haskell libraries
into an environment doesn't work.  Briefly: the directory where GHC
looks for packages is part of the ghc package, so it's immutable, and
a wrapper ghc package is needed.  You can use
haskellPackages.ghcWithPackages to create a GHC that knows about the
package you want.  If you're developing Haskell packages, use
cabal2nix to automate building your package...

Cheers,
Bryan


On Mon, 19 Oct 2015 22:07:47 -0400
Taeer Bar-Yam <tb442 at cornell.edu> wrote:

> Hey guys,
>   I added some haskell and python libraries to my configuration.nix
> environment.systemPackages, and they are appearing in
> /run/current-system/sw/lib/(relevant language)/ But when I try to use them
> from scripts, the programming language can't find them. Is there some way I
> need to tell the compiler/interpreter/language where to look?
> 
> Details:
>   Haskell:
> - package is io-memoize (though the problem occurred with other packages as
> well)
> - packages appear in
> /run/current-system/sw/lib/ghc-7.10.2/io-memoize-1.1.1.0/
> - Error message is:
>   Could not find module `System.IO.Memoize'
>   Locations searched:
>     System/IO/Memoize.hs
>     System/IO/Memoize.lhs
>     System/IO/Memoize.hsig
>     System/IO/Memoize.lhsig
> - It is interesting to note that the file that appears in
> /run/current-system/sw/lib/ghc-7.10.2/io-memoize-1.1.1.0/ does not have any
> of those file extensions. It is Memoize.hi.
>   But the standard library is also in .hi format, and those libraries load
> fine.
> 
>   Python:
> - numpy, matplotlib
> - seems to be in /run/current-system/sw/lib/python2.7/site-packages
> - Error message:
>   ImportError: No module named numpy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20151020/2a1a92e3/attachment.bin 


More information about the nix-dev mailing list