Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit 1b5a621

Browse files
orentbosd
authored andcommitted
Poppler backend: search for pdftopng in current environment
Fix situation where pdftopng is not found if executing python directly from an un-activated environment.
1 parent 706ea1a commit 1b5a621

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

camelot/backends/poppler_backend.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
import os
2+
import sys
13
import shutil
24
import subprocess
35

6+
path = os.path.dirname(sys.executable) + os.pathsep + os.environ['PATH']
47

58
class PopplerBackend:
69
def convert(self, pdf_path, png_path):
7-
pdftopng_executable = shutil.which("pdftopng")
10+
pdftopng_executable = shutil.which("pdftopng", path=path)
811
if pdftopng_executable is None:
912
raise OSError(
1013
"pdftopng is not installed. You can install it using the 'pip install pdftopng' command."

0 commit comments

Comments
 (0)