IngoMeyer441 / simple-term-menu

A Python package which creates simple interactive menus on the command line.
MIT License
492 stars 43 forks source link

ValueError: invalid literal for int() with base 10: '' #67

Closed TechWiz-3 closed 1 year ago

TechWiz-3 commented 1 year ago

First of all, thank you so much for your work on this project.

I'm receiving this error on Ubuntu 22.04. I download and extract a binary build of my script (which uses simple-term-menu) from here. When I run it though, I get the follow error:

tput: /tmp/_MEIRdZD9q/libtinfo.so.6: version `NCURSES6_TINFO_6.2.current' not found (required by tput)
Traceback (most recent call last):
  File "gcheat.py", line 107, in <module>
    render_main_menu()
  File "gcheat.py", line 51, in render_main_menu
    main_menu = TerminalMenu(choices, title="Git topics:")
  File "simple_term_menu.py", line 764, in __init__
  File "simple_term_menu.py", line 403, in __init__
  File "simple_term_menu.py", line 483, in preview_lines_count
  File "simple_term_menu.py", line 885, in _num_lines
ValueError: invalid literal for int() with base 10: ''

The weird thing is, if I run the same binary-building commands locally on my Ubuntu VM, the binary works perfectly fine. Any ideas what the error could be?

IngoMeyer441 commented 1 year ago

Hey and thanks for using simple-term-menu :smile:. Line 885 uses the tput command to get the height of the terminal, but tput in your build does not match the installed ncurses version (NCURSES6_TINFO_6.2.current' not found). I would guess that ncurses is missing on the test system.

TechWiz-3 commented 1 year ago

Yup thank you, that's what it turned out to be. I've got some weird things going on with that ubuntu instance 😅 I tried it on another instance and it worked.