We’re working on a feature to automatically install system dependencies when your install or add Python packages to your Repl. To make this work, we have a mapping from Python package to what it should install:
{
"pycairo": {"deps": [ "pkgs.pkg-config", "pkgs.cairo" ]},
"moviepy": {"deps": [ "pkgs.ffmpeg", "pkgs.imagemagickBig" ]},
"psycopg2": {"deps": [ "pkgs.postgresql" ], "libdeps": ["pkgs.postgresql"]}
}
For example, if you install pycairo
it would install pkg-config
and cairo
into the replit.nix
deps list.
Please help me make this map more complete! Post your python packaging problems below like this:
- The name of the Python library that is not working.
- A minimal code sample that doesn’t work.
- What needs to be added to
replit.nix
to make it work.
Here’s an example report:
pycairo
import cairo
with cairo.SVGSurface("example.svg", 200, 200) as surface:
context = cairo.Context(surface)
x, y, x1, y1 = 0.1, 0.5, 0.4, 0.9
x2, y2, x3, y3 = 0.6, 0.1, 0.9, 0.5
context.scale(200, 200)
context.set_line_width(0.04)
context.move_to(x, y)
context.curve_to(x1, y1, x2, y2, x3, y3)
context.stroke()
context.set_source_rgba(1, 0.2, 0.2, 0.6)
context.set_line_width(0.02)
context.move_to(x, y)
context.line_to(x1, y1)
context.move_to(x2, y2)
context.line_to(x3, y3)
context.stroke()
- Add
pkgs.pkg-config
andpkgs.cairo
to replit.nixdeps
.
If you don’t know how to fix it yourself, I’d still like to hear about all the Python packages that don’t work for you!