0

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
Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
Crabime
  • 644
  • 11
  • 27
  • When you run: `infocmp xterm` in a terminal, what is the output? – ivo Aug 30 '17 at 02:52
  • xterm|xterm terminal emulator (X Window System), am, bce, km, mc5i, mir, msgr, npc, xenl, colors#8, cols#80, it#8, lines#24, pairs#64, acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, – Crabime Aug 30 '17 at 02:56
  • Try changing the TERM in PyCharm to be `xterm-color` or `xterm`. If that doesn't work, I'm out of ideas. – ivo Aug 30 '17 at 03:12
  • changed both and still not work. – Crabime Aug 30 '17 at 03:21
  • There's only a few possibilities: (a) the environment `TERMINFO` isn't used by the application, (b) there's a non-Apple ncurses being used which isn't configured for the case-insensitive filesystem. – Thomas Dickey Aug 30 '17 at 20:06

1 Answers1

0

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
  • no... the question is about OSX, which has the file, and both its system library and add-ons such as MacPorts would have that description (OSX doesn't have `strace`). – Thomas Dickey Sep 04 '17 at 16:47