Skip to content

fish_config doesn't work without curses module #8487

Closed

Description

@TechDevJorge

Please tell us which fish version you are using by executing the following:

fish --version fish, version 3.3.1
echo $version

Please tell us which operating system and terminal you are using. The output of uname -a and echo $TERM may be helpful in this regard although other commands might be relevant in your specific situation.
Linux localhost.localdomain 4.18.0-305.7.1.el8_4.x86_64 #1 SMP Tue Jun 29 21:55:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Please tell us if you tried fish without third-party customizations by executing this command and whether it affected the behavior you are reporting:

sh -c 'env HOME=$(mktemp -d) fish'
Running that didn't help. I'm just trying to go into the config so I'll post my command/output below
tech@localhost ~> sh -c 'env HOME=$(mktemp -d) fish'
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
tech@localhost /h/tech> fish_config
Traceback (most recent call last):
File "/usr/share/fish/tools/web_config/webconfig.py", line 1547, in
esc = get_special_ansi_escapes()
File "/usr/share/fish/tools/web_config/webconfig.py", line 511, in get_special_ansi_escapes
import curses
File "/usr/local/lib/python3.9/curses/init.py", line 13, in
from _curses import *
ModuleNotFoundError: No module named '_curses'

Activity

  1. faho commented on Nov 25, 2021

    @faho
    Member

    You'll have to install the curses python module. If you build your own python, you'll have to install the ncurses headers (in the package ncurses-devel) before doing so. So you would now have to install that and rebuild python against it.

    If not, you'll have to check where RHEL packages it and install that.

  2. TechDevJorge commented on Nov 27, 2021

    @TechDevJorge
    Author

    Ok well I installed ncurses, but after that what am I supposed to do? I still get the same error when trying to open the fish_config
    tech@localhost /h/tech [1]> ncurses6-config --version
    6.1.20180224
    tech@localhost /h/tech>
    Did you mean I would have to completely reinstall Python after I installed the ncurses module?

  3. faho commented on Nov 27, 2021

    @faho
    Member

    You appear to have built python yourself, from source. That's why it's in /usr/local/. You built it before you had the ncurses headers installed, so you need to install those and rebuild python against them.

    This isn't a fish-specific issue, your python installation is incomplete. You can trigger it with:

    python3.9 -c 'import curses'
    

    (ncurses is really really quite important, and also a dependency of fish itself. the library itself was always installed, you're just missing the headers so things you build yourself can be built against it)

  4. TechDevJorge commented on Nov 27, 2021

    @TechDevJorge
    Author

    SO you're saying uninstall/reinstall Python? Or am i not understanding you correctly?

  5. faho commented on Nov 27, 2021

    @faho
    Member

    I am saying to rebuild python. You appear to have done something to install it that's not just yum install python, and that built it from source and that did not pick up the ncurses headers and so it did not build the curses module.

    The way to do that is to, yes, redo the steps you did to install python, making sure that it doesn't just pick up the same build again. It needs to actually compile it again, it can't just go "oh I made this python version already, let me just reuse that!". How to do that depends on how you built it.

    If you did just yum install python (or dnf), then you'll have to check with whoever built that package to get a curses module.

  6. TechDevJorge commented on Nov 27, 2021

    @TechDevJorge
    Author

    Wow... well i did reinstall python myself because it kept installing and older version of python and I wanted to install 3.9
    I dont remember how I installed it though. I'm gonna have to do some digging to see how to rebuild it.

  7. faho commented on Nov 27, 2021

    @faho
    Member

    Okay, I now made it so it would pick the xterm values if the curses module can't be loaded. We don't use it for a lot here, and the fallback is the correct choice in the majority of cases (because most modern terminals are like xterm in most things).

    The actual fix is still for you to fix your python installation, but only you can do that.

  8. changed the title [-]Trying to access fish_config[/-] [+]fish_config doesn't work without curses module[/+] on Nov 27, 2021
  9. added this to the fish 3.4.0 milestone on Nov 27, 2021
  10. added a commit that references this issue on Dec 12, 2021
  11. locked as resolved and limited conversation to collaborators on Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions