Skip to content

Hyfetch fails to run on Termux due to missing '/usr/bin/env' #286

Closed
@icewithcola

Description

Describe the bug

hyfetch cannot run on termux.

  • Does this issue still occur in the master branch? (Required)

Expected behavior

hyfetch should run normally on termux

Screenshots

Error: [Errno 2] No such file or directory: '/usr/bin/env'
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/hyfetch/main.py", line 424, in run
    asc = get_distro_ascii() if not args.ascii_file else Path(args.ascii_file).read_text("utf-8")
          ^^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/hyfetch/neofetch_util.py", line 317, in get_distro_ascii
    det = distro_detector.detect(distro or get_distro_name())
                                           ^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/hyfetch/neofetch_util.py", line 338, in get_distro_name
    return run_neofetch_cmd('ascii_distro_name', True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/hyfetch/neofetch_util.py", line 298, in run_neofetch_cmd
    return check_output(full_cmd).decode().strip()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 1951, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/env'

Environment

Termux 0.118.0
Android 14
Python 3.11.8

Additional context

I made a simple fix and fixed my problem but haven't tested on other platforms.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions