can't install poppler-utils
qinbatista
PROOP

2 months ago

I have all library in requirements.txt and docker build file, but still can't find poppler library

[2025-12-30 23:51:59] [art emoji] [x emoji] [ 0.82s] [_draw_flat_sketch_with_measurements] PDF generation failed: Unable to get page count. Is poppler installed and in PATH?

[2025-12-30 23:52:00] [art emoji] [x emoji] [ 1.28s] [_draw_flat_sketch_with_measurements] PDF generation failed: Unable to get page count. Is poppler installed and in PATH?

[2025-12-30 23:52:00] [art emoji] [x emoji] [ 1.28s] [_draw_flat_sketch_with_measurements] Error: Unable to get page count. Is poppler installed and in PATH?

$10 Bounty

11 Replies

qinbatista
PROOP

2 months ago

I installed pdf2image, this library needs poppler-utils, I added in the env, but it still can't find


Anonymous
FREE

2 months ago

Di ko pa Po magets masyado


ilyassbreth
FREE

2 months ago

if you're on railpack (default for new projects): just make sure pdf2image is in requirements.txt and redeploy. it'll auto-install poppler-utils.

if you're still on nixpacks (older projects): create a nixpacks.toml file:

[phases.setup]
aptPkgs = ['...', 'poppler-utils']

the '...' keeps existing packages. check which builder you're using in service settings → builder section


ilyassbreth

if you're on railpack (default for new projects): just make sure pdf2image is in requirements.txt and redeploy. it'll auto-install poppler-utils.if you're still on nixpacks (older projects): create a nixpacks.toml file:[phases.setup] aptPkgs = ['...', 'poppler-utils']the '...' keeps existing packages. check which builder you're using in service settings → builder section

qinbatista
PROOP

2 months ago

thank you, I checked my requirements.txt, pdf2image is included, I can see build log has
↳ Installing runtime apt packages for pdf2image: [poppler-utils]

But I still got generation failed: Unable to get page count. Is poppler installed and in PATH?


ilyassbreth
FREE

2 months ago

good;poppler is installed the issue is pdf2image can't find it at runtime. you need to tell pdf2image where poppler lives

in your code where you call convert_from_path() or convert_from_bytes(), add the poppler_path parameter:

python

from pdf2image import convert_from_path

images = convert_from_path('your.pdf', poppler_path='/usr/bin')

poppler-utils installs to /usr/bin on linux (which railway uses), so point pdf2image there explicitly and it should work


ilyassbreth

good;poppler is installed the issue is pdf2image can't find it at runtime. you need to tell pdf2image where poppler livesin your code where you call convert_from_path() or convert_from_bytes(), add the poppler_path parameter:pythonfrom pdf2image import convert_from_path images = convert_from_path('your.pdf', poppler_path='/usr/bin')poppler-utils installs to /usr/bin on linux (which railway uses), so point pdf2image there explicitly and it should work

qinbatista
PROOP

2 months ago

Sorry, the problem is the same. I found that the problem can be solved by manually installing the package via SSH
apt-get update && apt-get install -y poppler-utils

Is there a way to run this command when the instance is building? I tried NIXPACKS_APT_PKGS = poppler-utils which is not working


ilyassbreth
FREE

2 months ago

ah gotcha railpack installed it for build but you need it at runtime. add this environment variable to your railway service:

RAILPACK_DEPLOY_APT_PACKAGES=poppler-utils

this installs poppler-utils in the final runtime container, not just during build. that's why ssh install works but the build install doesn't persist

go to service settings → variables → add RAILPACK_DEPLOY_APT_PACKAGES with value poppler-utils, then redeploy


clifford-123
HOBBY

2 months ago

Hello qinbatista. I faced this same issue also before with pdf libraries. For some reason, even with the declared packages its not installing via railpack or nixpacks. What worked for me was switching to Dockerfile. In Dockerfile, you can place the exact commands that you need to install this.


ilyassbreth

ah gotcha railpack installed it for build but you need it at runtime. add this environment variable to your railway service:RAILPACK_DEPLOY_APT_PACKAGES=poppler-utilsthis installs poppler-utils in the final runtime container, not just during build. that's why ssh install works but the build install doesn't persistgo to service settings → variables → add RAILPACK_DEPLOY_APT_PACKAGES with value poppler-utils, then redeploy

qinbatista
PROOP

2 months ago

Thank you, this works, but I have multiple packages. I found I can enable all of them by:

RAILPACK_DEPLOY_APT_PACKAGES = librsvg2-bin poppler-utils

Hope this solution can help others.


clifford-123

Hello qinbatista. I faced this same issue also before with pdf libraries. For some reason, even with the declared packages its not installing via railpack or nixpacks. What worked for me was switching to Dockerfile. In Dockerfile, you can place the exact commands that you need to install this.

qinbatista
PROOP

2 months ago

Dockerfile is not the default setting for Railway; in order to avoid mistakes, I decided to use Railpack. You can install packages like this:
RAILPACK_DEPLOY_APT_PACKAGES = librsvg2-bin poppler-utils


qinbatista

Thank you, this works, but I have multiple packages. I found I can enable all of them by:RAILPACK_DEPLOY_APT_PACKAGES = librsvg2-bin poppler-utilsHope this solution can help others.

ilyassbreth
FREE

2 months ago

glad it's working! btw could you mark this as solved so the bounty gets awarded? would really appreciate it since we got you unstuck slightly_smiling_face emoji


Loading...