Home > other >  ModuleNotFoundError: No module named 'pacman_mirrors'
ModuleNotFoundError: No module named 'pacman_mirrors'

Time:12-31

when I try using pacman-mirrors to generate my mirror list I get the following error

~ % pacman-mirrors         
Traceback (most recent call last):
  File "/usr/bin/pacman-mirrors", line 20, in <module>
    from pacman_mirrors import pacman_mirrors
ModuleNotFoundError: No module named 'pacman_mirrors'

I have tried reinstalling pacman-mirrors, but I get the same error

~ % sudo pacman -S pacman-mirrors 
warning: pacman-mirrors-4.23.2-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) pacman-mirrors-4.23.2-1

Total Installed Size:  0.67 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                          [########################################] 100%
(1/1) checking package integrity                                        [########################################] 100%
(1/1) loading package files                                             [########################################] 100%
(1/1) checking for file conflicts                                       [########################################] 100%
(1/1) checking available disk space                                     [########################################] 100%
:: Processing package changes...
(1/1) reinstalling pacman-mirrors                                       [########################################] 100%
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Configuring pacman-mirrors ...
Traceback (most recent call last):
  File "/usr/bin/pacman-mirrors", line 20, in <module>
    from pacman_mirrors import pacman_mirrors
ModuleNotFoundError: No module named 'pacman_mirrors'
hint: use `pacman-mirrors` to generate and update your pacman mirrorlist.

Does anyone have any suggestions how to fix this?

Best Ottega

CodePudding user response:

I was also facing the same problem. As I searched through internet, I came across this solution and it worked fine.You can find the details here but to save time I'm also quoting the solution. https://www.nerd.vision/post/manjaro-modulenotfounderror-no-module-named-pacman-mirrors

  1. Navigate to the mirror-list file: sudo nano /etc/pacman.d/mirrorlist
  2. At the top of the file I added: Server = https://mirror.alpix.eu/manjaro/stable/$repo/$arch
  3. After saving the file I ran: sudo pacman -Syyu
  4. Then run this command : sudo pacman-mirrors --fasttrack && sudo pacman -Syyu

This generated my mirror-list using the fastest mirrors and edited the file for me. I Hope this will help you. <3

CodePudding user response:

I am also affected by this. I had to downgrade the package because I couldn't figure out why pacman-mirrors was throwing that error. This is by no means a solution but more of a workaround until this does get fixed upstream. I can say with relative certainty that this isn't anything we did wrong since it happens when you just update pacman-mirrors. If you have downgrade installed in pamac you can just issue the command:

sudo downgrade pacman-mirrors

Then you will be met with the following output:

Traceback (most recent call last):
  File "/usr/bin/pacman-mirrors", line 20, in <module>
    from pacman_mirrors import pacman_mirrors
ModuleNotFoundError: No module named 'pacman_mirrors'
Available packages (core):

-  1)  pacman-mirrors    4.22.0  3  /var/cache/pacman/pkg
-  2)  pacman-mirrors    4.23.1  5  /var/cache/pacman/pkg
   3)  pacman-mirrors    4.23.2  1  /var/cache/pacman/pkg

select a package by number: 2

Select the previous version you want rollback to. I picked 4.23.1 or option 2 from the list you see above. I hope this helps. Take care.

  • Related