Got stuck witha Nix package: Haskell, JuicyPixel


Sorry if this is obvious… I’ve been using Replit for a while, but this is the first time I need to install a Nix package.

I’m trying to get JuicyPixel work in Replit.

content of replit.nix:

{ pkgs }: {
    deps = [

At system dependencies I see Juicypixels as installed.

My Main.hs is so far an empty file with an import:

import Codec.Picture

When I hit “run”, or load Main.hs in ghci, or just try to import Codec.Picture in ghci,
I get the error

Main.hs:1:1: error:
    Could not find module ‘Codec.Picture’
    Locations searched:

Am I missing a step? Should I add a path somewhere?

Codec.Picture is part of the JuicyPixels package. In my computer, after installing JuicyPixels, I was immediately able to import Codec.Picture, and any other module of JP.

Thanks in advance.

Repl link/Link to where the bug appears:

Screenshots, links, or other helpful context:

Hey @mekispeter and welcome to the community!

If I am not mistaken, it should be:

import Codec.Picture.hs

Thank you for your answer, and also for the welcoming! :slight_smile:

Unfortunately, this raises a parse error. I’m sure the correct syntax of importing is without file extension. But apparently ghci thinks I want to import a local modul, so although JP is installed, ghc doesn’t know about it.


I found an example for JuicyPixels here, maybe you could fork this Repl and move your files here? (Is the screenshots folder necessary?)

(Their replit.nix file is different to yours, this might be why)


Just what I needed. It works now. Thank you!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.