[GH-ISSUE #418] Alpine Crash "FileNotFoundError: [Errno 2] No such file or directory: 'tput'" #255

Closed
opened 2026-02-25 20:33:11 +03:00 by kerem · 2 comments
Owner

Originally created by @mrneo240 on GitHub (Oct 1, 2020).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/418

$ cat /etc/os-release

NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.11.3
PRETTY_NAME="Alpine Linux v3.11"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"

$ asciinema rec

asciinema: recording asciicast to /tmp/tmpoa7wg6xn-ascii.cast
asciinema: press <ctrl-d> or type "exit" when you're done
Traceback (most recent call last):
  File "/usr/bin/asciinema", line 11, in <module>
    load_entry_point('asciinema==2.0.2', 'console_scripts', 'asciinema')()
  File "/usr/lib/python3.8/site-packages/asciinema/__main__.py", line 131, in main
    code = command.execute()
  File "/usr/lib/python3.8/site-packages/asciinema/commands/record.py", line 69, in execute
    asciinema.record_asciicast(
  File "/usr/lib/python3.8/site-packages/asciinema/__init__.py", line 33, in record_asciicast
    w, h = term.get_size()
  File "/usr/lib/python3.8/site-packages/asciinema/term.py", line 35, in get_size
    int(subprocess.check_output(['tput', 'cols'])),
  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 489, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'tput'
Originally created by @mrneo240 on GitHub (Oct 1, 2020). Original GitHub issue: https://github.com/asciinema/asciinema/issues/418 $ cat /etc/os-release ``` NAME="Alpine Linux" ID=alpine VERSION_ID=3.11.3 PRETTY_NAME="Alpine Linux v3.11" HOME_URL="https://alpinelinux.org/" BUG_REPORT_URL="https://bugs.alpinelinux.org/" ``` $ asciinema rec ``` asciinema: recording asciicast to /tmp/tmpoa7wg6xn-ascii.cast asciinema: press <ctrl-d> or type "exit" when you're done Traceback (most recent call last): File "/usr/bin/asciinema", line 11, in <module> load_entry_point('asciinema==2.0.2', 'console_scripts', 'asciinema')() File "/usr/lib/python3.8/site-packages/asciinema/__main__.py", line 131, in main code = command.execute() File "/usr/lib/python3.8/site-packages/asciinema/commands/record.py", line 69, in execute asciinema.record_asciicast( File "/usr/lib/python3.8/site-packages/asciinema/__init__.py", line 33, in record_asciicast w, h = term.get_size() File "/usr/lib/python3.8/site-packages/asciinema/term.py", line 35, in get_size int(subprocess.check_output(['tput', 'cols'])), File "/usr/lib/python3.8/subprocess.py", line 411, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.8/subprocess.py", line 489, in run with Popen(*popenargs, **kwargs) as process: File "/usr/lib/python3.8/subprocess.py", line 854, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'tput' ```
kerem closed this issue 2026-02-25 20:33:11 +03:00
Author
Owner

@arp242 commented on GitHub (Dec 6, 2020):

I have the same on Void Linux; turns out tput is part of the ncurses package, and installing that should fix it (on any Linux flavour).

I also created a PR which should fix it: #423

<!-- gh-comment-id:739463007 --> @arp242 commented on GitHub (Dec 6, 2020): I have the same on Void Linux; turns out `tput` is part of the `ncurses` package, and installing that should fix it (on any Linux flavour). I also created a PR which should fix it: #423
Author
Owner

@yangyang5214 commented on GitHub (May 10, 2021):

I try #423, not worked also

I cancel tput, return the result directly 😂

def get_size():
    # TODO maybe use os.get_terminal_size ?
    # return (
    #     int(subprocess.check_output(['tput', 'cols'])),
    #     int(subprocess.check_output(['tput', 'lines']))
    # )
    
    return (200, 50)
<!-- gh-comment-id:836201388 --> @yangyang5214 commented on GitHub (May 10, 2021): I try #423, not worked also I cancel *tput*, return the result directly 😂 ``` def get_size(): # TODO maybe use os.get_terminal_size ? # return ( # int(subprocess.check_output(['tput', 'cols'])), # int(subprocess.check_output(['tput', 'lines'])) # ) return (200, 50) ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#255
No description provided.