osx _curses.error: setupterm: could not find terminfo database

3.3k Views Asked by At

I'm using python curses and developing under PyCharm. but whatever a simple curses program, it always gives me such an exception. what i had tried were:

  • add export TERM="xterm-256color" and export TERMINFO="/usr/share/terminfo", but there was still appeared such exception:_curses.error: setupterm: could not find terminfo database(useless)
  • add such TERM environment variable into PyCharm run configuration like this way,but still ran failed, here is configuration screen capture: run configuration
1

There are 1 best solutions below

1
On

Complete "Hail Mary pass" from my site as I don't code in Python nor use OSX, but recently I've run into (maybe) similar problem when I linked my program against source compiled ncurses. Most probably due my fault during compilation, ncurses did not look for terminal database in "standard" locations. I've discovered this using strace on problematic binary.

A quick and dirty workaround for my problem was (assuming TERM=xterm-256color) to create separate terminfo database in my home directory and link system database into it:

mkdir ~/.terminfo
ln -s /lib/terminfo/x ~/.terminfo