Traceback (most recent call last):
File "/usr/bin/ocrmypdf", line 5, in <module>
from ocrmypdf.__main__ import run
[...]
ModuleNotFoundError: No module named 'rich'
same problem as @whxvd. Manually installing python-rich
fixes the issue.
Git Clone URL: | https://aur.archlinux.org/ocrmypdf.git (read-only, click to copy) |
---|---|
Package Base: | ocrmypdf |
Description: | A tool to add an OCR text layer to scanned PDF files, allowing them to be searched |
Upstream URL: | https://github.com/ocrmypdf/OCRmyPDF |
Licenses: | MPL2 |
Submitter: | dreuter |
Maintainer: | fbrennan (pigmonkey) |
Last Packager: | pigmonkey |
Votes: | 129 |
Popularity: | 2.63 |
First Submitted: | 2014-01-27 11:36 (UTC) |
Last Updated: | 2025-02-28 03:49 (UTC) |
Traceback (most recent call last):
File "/usr/bin/ocrmypdf", line 5, in <module>
from ocrmypdf.__main__ import run
[...]
ModuleNotFoundError: No module named 'rich'
same problem as @whxvd. Manually installing python-rich
fixes the issue.
Upstream changed a dependendency during the last version bump (coloredlogs
were replaced by rich
). See
git log v14.3.0..v14.4.0 -- pyproject.toml
git diff v14.3.0..v14.4.0 -- pyproject.toml
in the upstream repository. That is not (yet) reflected in this PKGBUILD
(and produces a non-functional ocrmypdf
on my system).
@marco Thank you Marco, the script works great with yay -Sc --noconfirm I prefered to place the log file there because the folder already existed logfile=~/.log/python3xRebuild.log
@sagittarius I have not an answer to your question. I followed expert suggestions and I write the script you see. The script works and now I can use ocrmypdf.
@marco yay -Scc --noconfirm ? Yay -Sc --noconfirm should be sufficient ?
If you're asking for help with automating yay, then ask in a yay support forum. Doesn't make sense to ask in the AUR, since there's no issues with this package.
Script updated, it is necessary clean the cache. Added yay -Scc. Is there a solution to avoid yay provide questions? The answer yes could be good for each question without time waste.
#!/bin/bash
logfile=~/log/python3xRebuild.log
echo START $(date) |tee -a $logfile
PYDIRS=$(stat -c '%W %n' /usr/lib/python[3-9].* | sort -n | head -n -1 | awk '{ print $2 }')
if [ -n "$PYDIRS" ]; then
yay -Scc
for d in $PYDIRS; do
#echo "Found obsolete python directory $d, packages requiring rebuild:"
for p in $(pacman -Qoq "$d"); do
command=$(echo yay -S $p --rebuildtree --noconfirm --rebuild)
echo $command |tee -a $logfile
eval $command
done
done
fi
I pinned my answer to this, thanks for helping me with replying to users.
To remind everyone, as the wiki states clearly:
Warning: AUR helpers are not supported by Arch Linux. You should become familiar with the manual build process in order to be prepared to troubleshoot problems.
This package will (probably) reinstall with your AUR helper, but the command I use to check if it's actually broken is makepkg --cleanbuild
then pacman -U ocrmypdf-14.2.0-1-any.tar.zst
.
did you read the answer to the previous comment where this exact error came up? rebuild the package.
Ok, the result is a useful package unusable. By using this script SOMETIME the problem is resolved.
#!/bin/bash
logfile=~/log/python3xRebuild.log
echo START $(date) |tee -a $logfile
PYDIRS=$(stat -c '%W %n' /usr/lib/python[3-9].* | sort -n | head -n -1 | awk '{ print $2 }')
if [ -n "$PYDIRS" ]; then
for d in $PYDIRS; do
#echo "Found obsolete python directory $d, packages requiring rebuild:"
for p in $(pacman -Qoq "$d"); do
command=$(echo yay -S $p --rebuildtree --noconfirm)
echo $command |tee -a $logfile
eval $command
done
done
fi
Do you have a definitive solution?
Pinned Comments
fbrennan commented on 2023-05-12 22:54 (UTC)
The flag was invalid and has been removed with no action taken as no new version was released. There's nothing to do for this package; no new release has been made. Rebuild, as @eclairevoyant has said.