Ocrmypdf -- how can I install it?

I can get to a “one click install” page, but the click just shows a bunch of XML that I cannot decipher. I have tried many times to get “one click install” working, but without success. “cnf” (Command Not Found) can’t find the command, either, but Google does find those one click XML thingies. Help, please?

Whether that “one click” works might depend on the browser. Have you tried with “firefox”?

And there are very bad experiences with “one click installs”. Better add the repo and install the package(s) you need using zypper.

Then most people will disable such a repo to avoid it being used unintetional on the future. Only to be enabled now and then to check if your packages have to be updated.

1 Like

Going here: OCRmyPDF only yields community package links and those are all “one click install” links. I did find an RPM, but it depends on a bunch of python3 stuff that I don’t know how to get either. (There’s a mess of python3, but not python3.11dist(whatever).

$ sudo rpm -i ocrmypdf-14.2.1-1.fc38.noarch.rpm 
warning: ocrmypdf-14.2.1-1.fc38.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID eb10b464: NOKEY
error: Failed dependencies:
        python(abi) = 3.11 is needed by ocrmypdf-14.2.1-1.fc38.noarch
        python3.11dist(coloredlogs) >= 14 is needed by ocrmypdf-14.2.1-1.fc38.noarch
        python3.11dist(deprecation) >= 2.1 is needed by ocrmypdf-14.2.1-1.fc38.noarch
        python3.11dist(img2pdf) >= 0.3 is needed by ocrmypdf-14.2.1-1.fc38.noarch
        python3.11dist(packaging) >= 20 is needed by ocrmypdf-14.2.1-1.fc38.noarch
        python3.11dist(pdfminer-six) >= 20201018 is needed by ocrmypdf-14.2.1-1.fc38.noarch
        python3.11dist(pikepdf) >= 5.0.1 is needed by ocrmypdf-14.2.1-1.fc38.noarch
        python3.11dist(pillow) >= 8.2 is needed by ocrmypdf-14.2.1-1.fc38.noarch
        python3.11dist(pluggy) >= 0.13 is needed by ocrmypdf-14.2.1-1.fc38.noarch
        python3.11dist(reportlab) >= 3.5.66 is needed by ocrmypdf-14.2.1-1.fc38.noarch
        python3.11dist(tqdm) >= 4 is needed by ocrmypdf-14.2.1-1.fc38.noarch
        tesseract >= 4.1.1 is needed by ocrmypdf-14.2.1-1.fc38.noarch

You try to install a Fedora package which is not even listed on the page you mentioned. Why not simply click on the Expert Download button and add the repo for leap 15.4 properly?

1 Like

“Expert download” gets me to this:

I don’t have a very good idea about what to do with that.

===== EDIT:

OK. I have to dig deeper and open up “add repo and install manually”. It is installed now. Thank you.

Oh, dear. Not done yet. Who in the “fstrba’s Home Project” might be able to give a hint?

$ ocrmypdf trump-indictment.pdf 
Traceback (most recent call last):
  File "/usr/bin/ocrmypdf", line 33, in <module>
    sys.exit(load_entry_point('ocrmypdf==12.3.3', 'console_scripts', 'ocrmypdf')())
  File "/usr/bin/ocrmypdf", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
  File "/usr/lib/python3.6/site-packages/importlib_metadata/__init__.py", line 526, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/lib/python3.6/site-packages/importlib_metadata/__init__.py", line 194, in from_name
    raise PackageNotFoundError(name)
importlib_metadata.PackageNotFoundError: ocrmypdf

No, they do not. Did you even try to click “Expert Download”?

Besides, repository URL is inside one click metadata that you get. It is not difficult to copy it and paste into zypper ar command line.

Installing Fedora RPM on openSUSE is very unlikely to work.

You may have a better luck using the Pip installation method from the ocrmypdf docs.

pip install --user ocrmypdf

Or even use the docker image provided in the wiki.

1 Like

I did have better luck. I am left with a question, though. All of the following files appear in my ~bin directory. There seem to be some potential name conflicts. I’m surprised by that, but I doubt it will be a big problem.

-rwxr-xr-x 1    210 Jun 13 11:18 tqdm
-rwxr-xr-x 1    219 Jun 13 11:18 humanfriendly
-rwxr-xr-x 1    247 Jun 13 11:18 normalizer
-rwxr-xr-x 1    217 Jun 13 11:18 coloredlogs
-rwxr-xr-x 1   9778 Jun 13 11:18 pdf2txt.py
-rwxr-xr-x 1  14315 Jun 13 11:18 dumppdf.py
drwxr-xr-x 2   4096 Jun 13 11:18 __pycache__
-rwxr-xr-x 1    961 Jun 13 11:18 img2pdf-gui
-rwxr-xr-x 1    961 Jun 13 11:18 img2pdf
-rwxr-xr-x 1    217 Jun 13 11:18 ocrmypdf

Also, the “pip install”-er makes the assumption that you want to install in $PWD/bin. Since I wasn’t in my home directory at the time, … I had to move the stuff. Not friendly. A “pip” RFE or bug report?

See man pip.
pip install --user Installs a package to the user’s directory instead of the system-wide default location. If you want to install it system-wide, use pip install