The new update broke ranger.

When I run ranger, I am getting following error:

Traceback (most recent call last):
  File "/usr/bin/ranger", line 35, in <module>
    import ranger  # NOQA pylint: disable=import-self,wrong-import-position
ModuleNotFoundError: No module named 'ranger'

How do I fix this?

Did you reboot yet?

Yes, right after the update and also something that I've noticed when I use which ranger I get /usr/bin/ranger but when I try to remove it by sudo pacman -R ranger, I get error: target not found: ranger

I thought maybe reinstalling will help, so I used sudo pacman -S ranger but now I get different error

resolving dependencies...
looking for conflicting packages...

Package (1)       New Version  Net Change

community/ranger  1.9.2-2        1.73 MiB

Total Installed Size:  1.73 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%
error: failed to commit transaction (conflicting files)
ranger: /usr/bin/ranger exists in filesystem
ranger: /usr/bin/rifle exists in filesystem
ranger: /usr/share/applications/ranger.desktop exists in filesystem
ranger: /usr/share/doc/ranger/CHANGELOG.md exists in filesystem
ranger: /usr/share/doc/ranger/HACKING.md exists in filesystem
ranger: /usr/share/doc/ranger/README.md exists in filesystem
ranger: /usr/share/doc/ranger/colorschemes.md exists in filesystem
ranger: /usr/share/doc/ranger/config/colorschemes/default.py exists in filesystem
ranger: /usr/share/doc/ranger/config/colorschemes/jungle.py exists in filesystem
ranger: /usr/share/doc/ranger/config/colorschemes/snow.py exists in filesystem
ranger: /usr/share/doc/ranger/config/commands.py exists in filesystem
ranger: /usr/share/doc/ranger/config/rc.conf exists in filesystem
ranger: /usr/share/doc/ranger/config/rifle.conf exists in filesystem
ranger: /usr/share/doc/ranger/config/scope.sh exists in filesystem
ranger: /usr/share/doc/ranger/examples/README exists in filesystem
ranger: /usr/share/doc/ranger/examples/bash_automatic_cd.sh exists in filesystem
ranger: /usr/share/doc/ranger/examples/bash_subshell_notice.sh exists in filesystem
ranger: /usr/share/doc/ranger/examples/plugin_avfs.py exists in filesystem
ranger: /usr/share/doc/ranger/examples/plugin_chmod_keybindings.py exists in filesystem
ranger: /usr/share/doc/ranger/examples/plugin_fasd_add.py exists in filesystem
ranger: /usr/share/doc/ranger/examples/plugin_file_filter.py exists in filesystem
ranger: /usr/share/doc/ranger/examples/plugin_hello_world.py exists in filesystem
ranger: /usr/share/doc/ranger/examples/plugin_ipc.py exists in filesystem
ranger: /usr/share/doc/ranger/examples/plugin_linemode.py exists in filesystem
ranger: /usr/share/doc/ranger/examples/plugin_new_macro.py exists in filesystem
ranger: /usr/share/doc/ranger/examples/plugin_new_sorting_method.py exists in filesystem
ranger: /usr/share/doc/ranger/examples/plugin_pmount.py exists in filesystem
ranger: /usr/share/doc/ranger/examples/plugin_pmount_dynamic.py exists in filesystem
ranger: /usr/share/doc/ranger/examples/rc_emacs.conf exists in filesystem
ranger: /usr/share/doc/ranger/examples/rifle_different_file_opener.conf exists in filesystem
ranger: /usr/share/doc/ranger/examples/rifle_sxiv.sh exists in filesystem
ranger: /usr/share/doc/ranger/examples/vim_file_chooser.vim exists in filesystem
ranger: /usr/share/doc/ranger/tools/convert_papermode_to_metadata.py exists in filesystem
ranger: /usr/share/doc/ranger/tools/performance_test.py exists in filesystem
ranger: /usr/share/doc/ranger/tools/print_colors.py exists in filesystem
ranger: /usr/share/doc/ranger/tools/print_keys.py exists in filesystem
Errors occurred, no packages were upgraded.

Try removing ranger again.

pacman -Rns ranger
 sudo pacman -Rns ranger
 error: target not found: ranger

Try the following command in a terminal window:

sudo pacman -Syu ranger --overwrite usr/bin/ranger,usr/bin/rifle,usr/share/*

For more information see here:

1 Like

Try the following command in a terminal window:

zsh: no matches found: usr/bin/ranger,usr/bin/rifle,usr/share/*

Then you are probably left with manually deleting the list of files.

In the off chance it is related to the Python update breaking installed AUR packages:

Try the proposed fix:

sudo pacman -S --needed --noconfirm expac yay
yay -S --rebuildtree $(pacman -Qmq $(expac %N python))

How do I do that?

I really can't understand what zsh has to do with the pacman command I posted above. :thinking:

Did you try to copy the command and paste it in the terminal?

Did you try to copy the command and paste it in the terminal?

yes, and I get the same output:

sudo pacman -Syu ranger --overwrite usr/bin/ranger,usr/bin/rifle,usr/share/*
zsh: no matches found: usr/bin/ranger,usr/bin/rifle,usr/share/*

Recent ranger related thread:

Nope, doesn't work with sudo either

As a last resort you could try - it is not the correct approach - but a workaround.

sudo pacman -Syu ranger --overwrite '*'

Do not do this on regular base - it can do bad things to your system - but in this case I don't think it will.

3 Likes

This worked, thank you :slight_smile:

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

Forum kindly sponsored by