After some strange mishap ( HDD disappeared from the system during a pacman update ) …
although already had a list of installed packages and reinstalled them with
sudo pacman -S $( list.txt)
At the end it gave some errors related to python and now
I am unable to execute pacman-mirrors
getting this kind of error:
$ pacman-mirrors
Traceback (most recent call last):
File "/bin/pacman-mirrors", line 5, in <module>
from pacman_mirrors.pacman_mirrors import start
File "/usr/lib/python3.12/site-packages/pacman_mirrors/pacman_mirrors.py", line 30, in <module>
from pacman_mirrors.builder import common, fasttrack, interactive
File "/usr/lib/python3.12/site-packages/pacman_mirrors/builder/common.py", line 24, in <module>
from pacman_mirrors.builder.builder import build_pool
File "/usr/lib/python3.12/site-packages/pacman_mirrors/builder/builder.py", line 26, in <module>
from pacman_mirrors.functions.outputFn import write_custom_mirrors_json
File "/usr/lib/python3.12/site-packages/pacman_mirrors/functions/outputFn.py", line 23, in <module>
from pacman_mirrors.functions import customFn
File "/usr/lib/python3.12/site-packages/pacman_mirrors/functions/customFn.py", line 22, in <module>
from pacman_mirrors.functions import defaultFn
File "/usr/lib/python3.12/site-packages/pacman_mirrors/functions/defaultFn.py", line 23, in <module>
from pacman_mirrors.functions import pools
File "/usr/lib/python3.12/site-packages/pacman_mirrors/functions/pools.py", line 23, in <module>
from pacman_mirrors.functions.httpFn import get_ip_country
File "/usr/lib/python3.12/site-packages/pacman_mirrors/functions/httpFn.py", line 36, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
As far as can tell something is wrong with python …
That is strange - the pacman-mirrors package depends on python-requests.
$ pamac info pacman-mirrors
Name : pacman-mirrors
Version : 4.24.1-2
Description : Manjaro Linux mirror list for use by pacman
URL : https://gitlab.manjaro.org/applications/pacman-mirrors
Licenses : GPL-3.0-or-later
Repository : core
Installed Size : 883,0 kB
Groups : --
Depends On : python python-npyscreen python-requests
Optional Dependencies : gtk3: for interactive mode (GUI) [Installed]
python-gobject: for interactive mode (GUI) [Installed]
Required By : libpamac manjaro-tools-base-git pacman pacman-contrib
Optional For : --
Provides : pacman-mirrorlist=4.24.1-2
Replaces : --
Conflicts With : pacman-mirrorlist reflector
Packager : Mark Wagie <mark@manjaro.org>
Build Date : lør 27 apr 2024 19:39:18 CEST
Install Date : man 27 maj 2024 10:07:16 CEST
Install Reason : Installed as a dependency for another package
Validated By : Signature
Backup files : /etc/pacman-mirrors.conf
sudo pacman-mirrors --continent
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/pacman_mirrors/functions/httpFn.py", line 227, in check_internet_connection
resp = requests.get(host, timeout=maxwait)
^^^^^^^^^^^^
AttributeError: module 'requests' has no attribute 'get'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/pacman-mirrors", line 8, in <module>
sys.exit(start())
^^^^^^^
File "/usr/lib/python3.12/site-packages/pacman_mirrors/pacman_mirrors.py", line 127, in start
app.run()
File "/usr/lib/python3.12/site-packages/pacman_mirrors/pacman_mirrors.py", line 96, in run
self.network = httpFn.check_internet_connection(tty=self.tty)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pacman_mirrors/functions/httpFn.py", line 230, in check_internet_connection
except (requests.exceptions.ConnectionError,) as connError:
^^^^^^^^^^^^^^^^^^^
AttributeError: module 'requests' has no attribute 'exceptions'
And I also had a “mishap” when I updated last friday - the system froze (kernel panic or smt), then I had to spend the afternoon trying to fix it, since the lastest kernel I had went missing. After usb chroot update, it started but I cannot update. I get PGP errors and nothign can be installed. When I try to change the mirrors I get the same error. (I tried fixing system time etc, nothing helps so far - packages get downloaded and then it gives PGP error).
But I keep forgetting to mention that there are multiple typos in the the man page for it.
–continent
Creates a custom mirror pool from geolocation
• Which countries has mirrors?
pacman-mirrors –country-list
• I want only https and http protocol in that order
sudo pacman-mirrors –country Germany,France –api –set-branch unstable –procotol https http
• Create a mirrorlist with German mirrors
sudo pacman-mirrors –country Germany
• If you want more countries in your mirrorlist add them they will be written to your custom mirror pool
sudo pacman-mirrors –country Germany France Denmark
• Create a mirrorlist with 5 mirrors up-to-date on your branch
sudo pacman-mirrors –fastrack 5
• I want to choose my mirrors
sudo pacman-mirrors –interactive
• I have a custom mirror list and I want to create a new custom mirror list?
sudo pacman-mirrors –interactive –default
• I have a custom mirror list - can I reset it?
sudo pacman-mirrors –country all
sudo pacman-mirrors --continent
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/pacman_mirrors/functions/httpFn.py", line 199, in check_internet_connection
resp = requests.get(host, timeout=maxwait)
^^^^^^^^^^^^
AttributeError: module 'requests' has no attribute 'get'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/pacman-mirrors", line 8, in <module>
sys.exit(start())
^^^^^^^
File "/usr/lib/python3.12/site-packages/pacman_mirrors/pacman_mirrors.py", line 148, in start
app.run()
File "/usr/lib/python3.12/site-packages/pacman_mirrors/pacman_mirrors.py", line 119, in run
self.network = httpFn.check_internet_connection(tty=self.tty)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pacman_mirrors/functions/httpFn.py", line 202, in check_internet_connection
except (requests.exceptions.ConnectionError,) as connError:
Returned back to pacman-mirrors, its intalllation ends with the same error. Trying the -f option gives the same errorr. Pretty much all of the help commands return the same error (only -G, -l, -lc, --status worked) .
I guess the only thing I could do is to disable to PGP keys from the conf file and update. Otherwise apparently the system doesn’t recognize the PGP keys and refuses to do anything. And this python error is rather strange. Python is working fine on my system.
>python --version
Python 3.12.3
>pacman-mirrors --version
Version 4.24.0
[PACMAN] Running 'pacman -S pacman-mirrors'
[2024-06-12T11:59:41+0300] [ALPM] transaction started
[2024-06-12T11:59:41+0300] [ALPM] removed pacman-mirrors-dev (5.0.2-2)
[2024-06-12T11:59:41+0300] [ALPM] installed pacman-mirrors (4.24.1-2)
[2024-06-12T11:59:42+0300] [ALPM] transaction completed
[2024-06-12T11:59:42+0300] [ALPM] running '30-systemd-update.hook'...
[2024-06-12T11:59:42+0300] [ALPM] running '90-packagekit-refresh.hook'...
[2024-06-12T11:59:42+0300] [ALPM] running 'pacman-mirrors-install.hook'...
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] Your current config has been restored.
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] A new pacman-mirrors.conf is created as /etc/pacman-mirrors-new-20240612.conf
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] Please verify you're not missing any changes
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] Traceback (most recent call last):
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] File "/usr/lib/python3.12/site-packages/pacman_mirrors/functions/httpFn.py", line 227, in check_internet_connection
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] resp = requests.get(host, timeout=maxwait)
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] ^^^^^^^^^^^^
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] AttributeError: module 'requests' has no attribute 'get'
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET]
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] During handling of the above exception, another exception occurred:
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET]
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] Traceback (most recent call last):
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] File "/usr/bin/pacman-mirrors", line 8, in <module>
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] sys.exit(start())
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] ^^^^^^^
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] File "/usr/lib/python3.12/site-packages/pacman_mirrors/pacman_mirrors.py", line 127, in start
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] app.run()
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] File "/usr/lib/python3.12/site-packages/pacman_mirrors/pacman_mirrors.py", line 96, in run
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] self.network = httpFn.check_internet_connection(tty=self.tty)
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] File "/usr/lib/python3.12/site-packages/pacman_mirrors/functions/httpFn.py", line 230, in check_internet_connection
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] except (requests.exceptions.ConnectionError,) as connError:
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] ^^^^^^^^^^^^^^^^^^^
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] AttributeError: module 'requests' has no attribute 'exceptions'
[2024-06-12T11:59:42+0300] [ALPM-SCRIPTLET] hint: use `pacman-mirrors` to generate and update your pacman mirrorlist.
Apart from that I can use just pacman-mirrors:
sudo pacman-mirrors
Pacman-mirrors version 4.24.0
Local mirror status for stable branch
Mirror #1 OK 00:12 Germany https://mirror.alpix.eu/manjaro/
Mirror #2 OK 02:04 Belgium https://mirror.futureweb.be/manjaro/
Mirror #3 OK 02:22 Denmark https://mirrors.dotsrc.org/manjaro/
Mirror #4 OK 05:52 Estonia https://mirrors.xtom.ee/manjaro/
Mirror #5 OK 01:06 Spain https://mirrors.ft.uam.es/manjaro/
Mirror #6 OK 01:05 Netherlands https://mirror.bouwhuis.network/manjaro/
Mirror #7 -- 13:33 Iran https://repo.iut.ac.ir/repo/manjaro/
Mirror #8 OK 07:32 China https://mirrors.jlu.edu.cn/manjaro/
but if I want to choose a specific country I get:
sudo pacman-mirrors -c Germany
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/pacman_mirrors/functions/httpFn.py", line 227, in check_internet_connection
resp = requests.get(host, timeout=maxwait)
^^^^^^^^^^^^
AttributeError: module 'requests' has no attribute 'get'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/pacman-mirrors", line 8, in <module>
sys.exit(start())
^^^^^^^
File "/usr/lib/python3.12/site-packages/pacman_mirrors/pacman_mirrors.py", line 127, in start
app.run()
File "/usr/lib/python3.12/site-packages/pacman_mirrors/pacman_mirrors.py", line 96, in run
self.network = httpFn.check_internet_connection(tty=self.tty)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pacman_mirrors/functions/httpFn.py", line 230, in check_internet_connection
except (requests.exceptions.ConnectionError,) as connError:
^^^^^^^^^^^^^^^^^^^
AttributeError: module 'requests' has no attribute 'exceptions'
this does not generate a new error in /var/log/pacman.log.
sudo pacman -S python-requests
решаване на зависимости...
търсене за конфликтни пакети...
Пакети (1) python-requests-2.32.3-1
Общ инсталиран размер: 0,60 MiB
:: Продължаване с инсталацията? [Y/n] y
(1/1) проверка на ключовете [#######################################################################] 100%
(1/1) проверка пакетна цялост [#######################################################################] 100%
грешка: python-requests: подписът от "Daniel M. Capella <polyzen@archlinux.org>" е с непознато доверие
:: Файл /var/cache/pacman/pkg/python-requests-2.32.3-1-any.pkg.tar.zst е повреден (невалиден или повреден пакет (PGP signature)).
Искате ли да го изтриете? [Y/n] n
грешка: неуспех в задаването на транзакцията (невалиден или повреден пакет (PGP signature))
Поява на грешки, няма обновени пакети.
ipx install requests
Note: Dependent package 'charset-normalizer' contains 1 apps
- normalizer
No apps associated with package requests. Try again with '--include-deps' to include apps of dependent packages, which are listed above. If you are attempting to install a library, pipx should
not be used. Consider using pip or a similar tool instead.
pipx install requests --include-deps
⚠ Note: normalizer was already on your PATH at /usr/bin/normalizer
installed package requests 2.32.3, installed using Python 3.12.3
These apps are now globally available
- normalizer
done! ✨ 🌟 ✨
and then when I try again
sudo pacman-mirrors -c Germany
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/pacman_mirrors/functions/httpFn.py", line 227, in check_internet_connection
resp = requests.get(host, timeout=maxwait)
^^^^^^^^^^^^
AttributeError: module 'requests' has no attribute 'get'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/pacman-mirrors", line 8, in <module>
sys.exit(start())
^^^^^^^
File "/usr/lib/python3.12/site-packages/pacman_mirrors/pacman_mirrors.py", line 127, in start
app.run()
File "/usr/lib/python3.12/site-packages/pacman_mirrors/pacman_mirrors.py", line 96, in run
self.network = httpFn.check_internet_connection(tty=self.tty)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pacman_mirrors/functions/httpFn.py", line 230, in check_internet_connection
except (requests.exceptions.ConnectionError,) as connError:
^^^^^^^^^^^^^^^^^^^
AttributeError: module 'requests' has no attribute 'exceptions'
I find it very strange that something so important would come without its dependencies.
Also, my real issue is not with pacman-mirrors but with system failing to update or install anything due to “invalid or broken package (PGP signature)”.
I stumbled on this post when googling the PGP problem since I thought maybe my mirrors are old or something. Because it doesn’t recognise any PGP signature.
pip show requests
WARNING: Skipping /usr/lib/python3.12/site-packages/requests-2.32.2.dist-info due to invalid metadata entry 'name'
WARNING: Package(s) not found: requests
why i view this ???
pipx is only for Isolated Environments
run pacman-mirrors in isolated environment is not good.
if we install with pip/pipx, we break your config system
you use a bad “request” library in home or python venv
pip list --user | grep request # return nothing or bad install
Nah, my conda is deactivated, but ok, I did the crazy thing:
pip install requests --break-system-packages
and that gave few errors but installed. Now I can see the package:
pip list --user | grep request
WARNING: Skipping /usr/lib/python3.12/site-packages/requests-2.32.2.dist-info due to invalid metadata entry 'name'
requests 2.32.3
WARNING: Skipping /usr/lib/python3.12/site-packages/requests-2.32.2.dist-info due to invalid metadata entry 'name'
WARNING: Skipping /usr/lib/python3.12/site-packages/requests-2.32.2.dist-info due to invalid metadata entry 'name'
without restarting, I still get the same error from “sudo pacman-mirrors -c Germany” (AttributeError: module ‘requests’ has no attribute ‘exceptions’).
But I cannot restart right now and usually python packages appear immediately after installed so it shouldn’t be the problem.