-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
Open
Labels
0.kind: bugSomething is brokenSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Description
Take the following flake (nixpkgs rev is 1e56a3b):
{
inputs.nixpkgs.url = github:nixos/nixpkgs;
outputs =
{ self
, nixpkgs
}: {
devShell.x86_64-linux =
let
system = "x86_64-linux";
pkgs = (import nixpkgs { inherit system; }).pkgs;
in
pkgs.mkShell {
buildInputs = (with pkgs; [
(python3.withPackages (p: with p; [
camelot
]))
]);
};
};
}
Now, start python and (or presumably use any other PDF)
import camelot
tables = camelot.read_pdf("tlv3511-q1.pdf")
This emits the error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/nix/store/8kbmmpb8r84y89132q6bpcj85an1n0sv-python3-3.12.7-env/lib/python3.12/site-packages/camelot/io.py", line 113, in read_pdf
tables = p.parse(
^^^^^^^^
File "/nix/store/8kbmmpb8r84y89132q6bpcj85an1n0sv-python3-3.12.7-env/lib/python3.12/site-packages/camelot/handlers.py", line 176, in parse
t = parser.extract_tables(
^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/8kbmmpb8r84y89132q6bpcj85an1n0sv-python3-3.12.7-env/lib/python3.12/site-packages/camelot/parsers/lattice.py", line 421, in extract_tables
self.backend.convert(self.filename, self.imagename)
File "/nix/store/8kbmmpb8r84y89132q6bpcj85an1n0sv-python3-3.12.7-env/lib/python3.12/site-packages/camelot/backends/ghostscript_backend.py", line 31, in convert
raise OSError(
OSError: Ghostscript is not installed. You can install it using the instructions here: https://camelot-py.readthedocs.io/en/master/user/install-deps.html
I can explicitly provide ghostscript in the flake with (though it should be a runtime dependency)
{
inputs.nixpkgs.url = github:nixos/nixpkgs;
outputs =
{ self
, nixpkgs
}: {
devShell.x86_64-linux =
let
system = "x86_64-linux";
pkgs = (import nixpkgs { inherit system; }).pkgs;
in
pkgs.mkShell {
buildInputs = (with pkgs; [
(python3.withPackages (p: with p; [
camelot
]))
ghostscript
]);
};
};
}
Then, the error is
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/nix/store/8kbmmpb8r84y89132q6bpcj85an1n0sv-python3-3.12.7-env/lib/python3.12/site-packages/camelot/io.py", line 113, in read_pdf
tables = p.parse(
^^^^^^^^
File "/nix/store/8kbmmpb8r84y89132q6bpcj85an1n0sv-python3-3.12.7-env/lib/python3.12/site-packages/camelot/handlers.py", line 176, in parse
t = parser.extract_tables(
^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/8kbmmpb8r84y89132q6bpcj85an1n0sv-python3-3.12.7-env/lib/python3.12/site-packages/camelot/parsers/lattice.py", line 421, in extract_tables
self.backend.convert(self.filename, self.imagename)
File "/nix/store/8kbmmpb8r84y89132q6bpcj85an1n0sv-python3-3.12.7-env/lib/python3.12/site-packages/camelot/backends/ghostscript_backend.py", line 36, in convert
import ghostscript
ModuleNotFoundError: No module named 'ghostscript'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
0.kind: bugSomething is brokenSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md