AUR package giving error during build process

Hi
I am trying to install “python-coloredlogs” as a dependency of “ocrmypdf”. However, during the build process, the package gives following error:

==> Starting build()...
/home/sal/.cache/paru/clone/python-coloredlogs/src/python-coloredlogs-15.0.1/setup.py:24: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.sysconfig
/home/admin/.cache/paru/clone/python-coloredlogs/src/python-coloredlogs-15.0.1/setup.py:24: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig
Traceback (most recent call last):
  File "/home/sal/.cache/paru/clone/python-coloredlogs/src/python-coloredlogs-15.0.1/setup.py", line 30, in <module>
    from setuptools import find_packages, setup
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 16, in <module>
    import setuptools.version
  File "/usr/lib/python3.10/site-packages/setuptools/version.py", line 1, in <module>
    import pkg_resources
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3266, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3240, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3278, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 564, in _build_master
    ws = cls()
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 557, in __init__
    self.add_entry(entry)
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 613, in add_entry
    for dist in find_distributions(entry, True):
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2077, in find_on_path
    for dist in factory(fullpath):
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2135, in distributions_from_metadata
    if len(os.listdir(path)) == 0:
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.10/site-packages/click-8.1.2.dist-info'
==> ERROR: A failure occurred in build().
    Aborting...
error: failed to build 'python-coloredlogs-15.0.1-3': 
error: packages failed to build: python-coloredlogs-15.0.1-3

I do not have sufficient knowledge about Python, therefore, I am struggling to understand this error. So, kindly guide to fix this error? Thanks

Reading the pinned comments in the aur it looks like it hasn’t been updated in a while and maybe broken

Edit

It was updated on 23/01 so not that out of date

https://aur.archlinux.org/packages/python-coloredlogs

Reading some comments on ocrmypdf’s AUR page suggest that you need to rebuild those python packages before proceeding with that upgrade:

pamac install python-coloredlogs
pamac upgrade -a

https://aur.archlinux.org/packages/ocrmypdf#comment-840825

https://aur.archlinux.org/packages/ocrmypdf#comment-810211

Please correct me if I am wrong:
By reading the comments, what I understand is to uninstall and delete the ~/.cache/paru/clone/python-coloredlogs, and try to install it a fresh. So I did, but now even python-coloredlogs is giving same error during build process.