Problems with pacman-mirrors

Hello o everyone,

i encounter a problem using pacman-mirrors. Everytime i use the command i get the following error:

Traceback (most recent call last):
  File "/usr/bin/pacman-mirrors", line 20, in <module>
    from pacman_mirrors import pacman_mirrors
  File "/usr/lib/python3.10/site-packages/pacman_mirrors/", line 31, in <module>
    from pacman_mirrors.builder import common, fasttrack, interactive
  File "/usr/lib/python3.10/site-packages/pacman_mirrors/builder/", line 24, in <module>
    from pacman_mirrors.builder.builder import build_pool
  File "/usr/lib/python3.10/site-packages/pacman_mirrors/builder/", line 26, in <module>
    from pacman_mirrors.functions.outputFn import write_custom_mirrors_json
  File "/usr/lib/python3.10/site-packages/pacman_mirrors/functions/", line 23, in <module>
    from pacman_mirrors.functions import customFn
  File "/usr/lib/python3.10/site-packages/pacman_mirrors/functions/", line 22, in <module>
    from pacman_mirrors.functions import defaultFn
  File "/usr/lib/python3.10/site-packages/pacman_mirrors/functions/", line 23, in <module>
    from pacman_mirrors.functions import pools
  File "/usr/lib/python3.10/site-packages/pacman_mirrors/functions/", line 23, in <module>
    from pacman_mirrors.functions.httpFn import get_ip_country
  File "/usr/lib/python3.10/site-packages/pacman_mirrors/functions/", line 36, in <module>
    import requests
  File "/root/.local/lib/python3.10/site-packages/requests/", line 58, in <module>
    from . import utils
  File "/root/.local/lib/python3.10/site-packages/requests/", line 26, in <module>
    from .compat import parse_http_list as _parse_list_header
  File "/root/.local/lib/python3.10/site-packages/requests/", line 7, in <module>
    from .packages import chardet
  File "/root/.local/lib/python3.10/site-packages/requests/packages/", line 3, in <module>
    from . import urllib3
  File "/root/.local/lib/python3.10/site-packages/requests/packages/urllib3/", line 10, in <module>
    from .connectionpool import (
  File "/root/.local/lib/python3.10/site-packages/requests/packages/urllib3/", line 38, in <module>
    from .response import HTTPResponse
  File "/root/.local/lib/python3.10/site-packages/requests/packages/urllib3/", line 5, in <module>
    from ._collections import HTTPHeaderDict
  File "/root/.local/lib/python3.10/site-packages/requests/packages/urllib3/", line 1, in <module>
    from collections import Mapping, MutableMapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/

Could thus also be the reasn why i cant upgrade the AUR packages? Sorry for the question, still new :slight_smile:

The pacman-mirrors version ist 4.23.2-2



$ LANG=C pamac search --files /usr/lib/python3.10/collections/ 
/usr/lib/python3.10/collections/ is owned by python
/usr/lib/python3.10/collections/__pycache__/__init__.cpython-310.opt-1.pyc is owned by python
/usr/lib/python3.10/collections/__pycache__/__init__.cpython-310.opt-2.pyc is owned by python
/usr/lib/python3.10/collections/__pycache__/__init__.cpython-310.pyc is owned by python
/usr/lib/python3.10/collections/__pycache__/abc.cpython-310.opt-1.pyc is owned by python
/usr/lib/python3.10/collections/__pycache__/abc.cpython-310.opt-2.pyc is owned by python
/usr/lib/python3.10/collections/__pycache__/abc.cpython-310.pyc is owned by python
/usr/lib/python3.10/collections/ is owned by python

Looks like python is not installed on your system?

in fact it is installed:

python --version                                                                                                                                                                
Python 3.10.4

Reinstall it?

pamac reinstall python

unfortunately, the same problem after reinstall.

Are you using some virtual environment tool or pyenv or something similar? That is not a system folder, it is a local folder of your root user.

1 Like

I think I know what it is. You have installed requests Python module with pip install --user as root. Probably it is some old version.

I would say that probably it is safe to delete the .local folder of your root user, but I don’t know what else can be in there. You’ll have to check first.

hey, thanks for your answer. i deleted the folder, but i still get the same error

pacman-mirrors is not at fault here - your system is in a bad shape.

Blame it on your sys-admin.

1 Like

Is it really the same? If you deleted the folder it is not possible, because the error you posted comes from that folder

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.