AUR package giving error during build process

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/ 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/ 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/", line 30, in <module>
    from setuptools import find_packages, setup
  File "/usr/lib/python3.10/site-packages/setuptools/", line 16, in <module>
    import setuptools.version
  File "/usr/lib/python3.10/site-packages/setuptools/", line 1, in <module>
    import pkg_resources
  File "/usr/lib/python3.10/site-packages/pkg_resources/", line 3266, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3.10/site-packages/pkg_resources/", line 3240, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/pkg_resources/", line 3278, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.10/site-packages/pkg_resources/", line 564, in _build_master
    ws = cls()
  File "/usr/lib/python3.10/site-packages/pkg_resources/", line 557, in __init__
  File "/usr/lib/python3.10/site-packages/pkg_resources/", line 613, in add_entry
    for dist in find_distributions(entry, True):
  File "/usr/lib/python3.10/site-packages/pkg_resources/", line 2077, in find_on_path
    for dist in factory(fullpath):
  File "/usr/lib/python3.10/site-packages/pkg_resources/", 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().
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


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

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

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.