• ImportError with libncursesw.so.5


    With a recent update I seem to have broken the curses python package.

    I need it for the programs ranger and glances.

    If I try to start ranger, I get this error message.

    $ ranger
    Traceback (most recent call last):
      File "/usr/sbin/ranger", line 39, in <module>
        sys.exit(ranger.main())
      File "/usr/lib/python3.6/site-packages/ranger/core/main.py", line 15, in main
        from ranger.container.settings import Settings
      File "/usr/lib/python3.6/site-packages/ranger/container/settings.py", line 7, in <module>
        from ranger.gui.colorscheme import _colorscheme_name_to_class
      File "/usr/lib/python3.6/site-packages/ranger/gui/colorscheme.py", line 28, in <module>
        from curses import color_pair
      File "/usr/lib/python3.6/curses/__init__.py", line 13, in <module>
        from _curses import *
    ImportError: libncursesw.so.5: cannot open shared object file: No such file or directory
    

    Any ideas how to fix this error?

    thank you.

  • ImportError: libncursesw.so.5: cannot open shared object file: No such file or directory

    $ pkgfile libncursesw.so       # which package the missing file belongs too?
    core/ncurses
    multilib/lib32-ncurses
    
    $ pkgfile -l ncurses | grep libncursesw.so       # which files with this name the package contains?
    core/ncurses	/usr/lib/libncursesw.so
    core/ncurses	/usr/lib/libncursesw.so.6        # aha! seems like there is a new version!
    core/ncurses	/usr/lib/libncursesw.so.6.0
    
    $ expac -Q '%v' ncurses    # what is the current version of the ncurses package?
    6.0+20170902-1
    
    

    So, currently, the arch ncurses package is on version 6 and your ranger program is still dependent on 5. This means that ranger hasn’t been updated, but one of its dependencies has. This is a typical partial upgrade scenario.

    To fix this issue the following command:

    sudo pacman -Syyu     # force a database sync and upgrade the whole system
    

    And in the future, to avoid similar problems with this or any other package, follow these rules:

    • Do not use pacman -Sy <package> to install a package.
    • Likewise, do not use pacman -Sy followed by pacman -S <package>.
    • In short, never use -Sy
    • Always upgrade the system with pacman -Syu
    • And until the next time you upgrade the system, install any new packages with pacman -S <package>
  • @Krugar

    Thank you for the advice. The versions are the same as on my system.

    However, running pacman -Syyu does not change anything, neither does reinstalling the ranger package with pacman -S ranger.

    What else could be the problem?

    Also, there is one thing, I don’t understand. If ranger relies on ncurses version 5, then I would assume that the package has been broken earlier because if I run the program downgrade ncurses, it shows me this

    $ downgrade ncurses
    Available packages:
    
    *  1) ncurses-6.0+20170902-1-x86_64.pkg.tar.xz (remote)
    *  2) ncurses-6.0+20170902-1-x86_64.pkg.tar.xz (local)
       3) ncurses-6.0+20170827-1-x86_64.pkg.tar.xz (remote)
       4) ncurses-6.0+20170827-1-x86_64.pkg.tar.xz (local)
    *  5) ncurses-6.0+20170527-1-x86_64.pkg.tar.xz (remote)
    *  6) ncurses-6.0+20170429-1-x86_64.pkg.tar.xz (remote)
    *  7) ncurses-6.0+20170401-1-x86_64.pkg.tar.xz (remote)
    *  8) ncurses-6.0+20170128-1-x86_64.pkg.tar.xz (remote)
    *  9) ncurses-6.0+20161224-1-x86_64.pkg.tar.xz (remote)
    * 10) ncurses-6.0+20161203-1-x86_64.pkg.tar.xz (remote)
    * 11) ncurses-6.0+20161112-1-x86_64.pkg.tar.xz (remote)
      12) ncurses-6.0-4-x86_64.pkg.tar.xz (remote)
      13) ncurses-6.0-3-x86_64.pkg.tar.xz (remote)
      14) ncurses-6.0-2-x86_64.pkg.tar.xz (remote)
      15) ncurses-6.0-1-x86_64.pkg.tar.xz (remote)
      16) ncurses-5.9_20141101-1-x86_64.pkg.tar.xz (remote)
      17) ncurses-5.9_20141101-1-x86_64.pkg.tar.xz (local)
      18) ncurses-5.9-7-x86_64.pkg.tar.xz (remote)
      19) ncurses-5.9-7-x86_64.pkg.tar.xz (local)
      20) ncurses-5.9-6-x86_64.pkg.tar.xz (remote)
      21) ncurses-5.9-5-x86_64.pkg.tar.xz (remote)
    

    It seems like ncurses version 5 is outdated since quite a while.

  • What’s your ranger version?

  • @Krugar said in ImportError with libncursesw.so.5:

    What’s your ranger version?

    1.8.1-1 is the version with the import error (see post above), but if I downgrade to version 1.8.0-1 it is working fine.

    I still could not manage to get glances running again.

importerror1 Posts 5Views 193
Log in to reply