Skip to content

[Bug]: Could not found Ghostscript #1598

@Hellfar

Description

@Hellfar

What were you trying to do?

Hello,

I am trying to use OCRmyPDF in a Python program.

It is basically not finding ghostscript and jbig2.
Where I could not find a proper way to install jbig2 (I mean not from a link from where nothing about the compilation details been shared), I DID install ghostscript and is present from my PATH as everywhere else when I try to use it gs --version it output me 10.05.1.
I do not understand what I did wrong as I am sure I made a mistake somewhere since I am a noob in this area, but still this is obscure to me.

Feel free to ask more information.

Where are you installing/running from?

PyPI (pip, poetry, pipx, etc.)

OCRmyPDF version

16.12.0

What operating system are you working on?

Windows

Operating system details and version

Windows 10 Pro 22H2 (OS Build: 19045.6466)

Simple sanity checks

  • Operating system is currently supported by its vendor (not end of life)
  • Python version is compatible with OCRmyPDF
  • This issue is not about a specific input file

Relevant log output

When in the part where it is running `ocrmypdf` it is outputting the following error meaning it could not find `ghostscript`:  

Loading pages and preprocessing with OpenCV...
Running ocrmypdf... please wait.
[WinError 2] The system cannot find the file specified                                                   _windows.py:87
[WinError 2] The system cannot find the file specified                                                   _windows.py:99
                                                                                                        __init__.py:275
The program 'jbig2' could not be executed or was not found on your
system PATH.  This program is recommended when using the --optimize {2,3} | --jbig2-lossy arguments,
but not required, so we will proceed.  For best results, install the program.

                                                                                                        __init__.py:267
If not already installed, install the Chocolatey package manager. Then use
a command prompt to install the missing package:
    choco install jbig2enc

[WinError 2] The system cannot find the file specified                                                   _windows.py:87
[WinError 2] The system cannot find the file specified                                                   _windows.py:99
                                                                                                        __init__.py:279
The program 'gs' could not be executed or was not found on your
system PATH.

                                                                                                        __init__.py:267
If not already installed, install the Chocolatey package manager. Then use
a command prompt to install the missing package:
    choco install ghostscript

Could not find program 'gswin64c' on the PATH                                                            __main__.py:69
ocrmypdf failed: Command '['ocrmypdf', '--force-ocr', '--deskew', '--rotate-pages', '--optimize', '3', '--output-type', 'pdfa', '-l', 'eng+fra', 'C:\\Users\\Hellfar\\AppData\\Local\\Temp\\tmp78k4ewtq\\intermediate_images.pdf', 'output.pdf']' returned non-zero exit status 3.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions