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

Taeer Bar-Yam tb442 at cornell.edu
Sun Oct 25 02:55:16 CEST 2015


Thank you all so much. The Haskell fix works, and the explanation was very
helpful; the python fix worked too! For those who are potentially looking
at this in the future, it might be nice to know you can set this in
configuration.nix with:
environment.variables.PYTHONPATH =
"/run/current-system/sw/lib/python2.7/site-packages";

On Tue, Oct 20, 2015 at 5:13 PM, Bryan Gardiner <bog at khumba.net> wrote:

> 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
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20151024/74a8b3b1/attachment.html 


More information about the nix-dev mailing list