eli64s / readme-ai

README file generator, powered by large language model APIs 👾

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FileNotFoundError: [Errno 2] No such file or directory: 'tree'

jKh98 opened this issue · comments

Hello, I found your tool today and I am a big fan. However, I am getting this error when trying it on my remote repository.
Thanks for your help

Traceback (most recent call last):

  File "/Users/jkh98/Developer/Scratch/README-AI/src/main.py", line 103, in <module>
    app()

  File "/Users/jkh98/Developer/Scratch/README-AI/src/main.py", line 41, in main
    asyncio.run(generate_readme(api_key, local, output, remote))

  File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^

  File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^

  File "/Users/jkh98/Developer/Scratch/README-AI/src/main.py", line 91, in generate_readme
    builder.build(conf, conf_helper, dependencies, documentation, intro_slogan)

  File "/Users/jkh98/Developer/Scratch/README-AI/src/builder.py", line 60, in build
    md_repo = create_directory_tree(url)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/jkh98/Developer/Scratch/README-AI/src/builder.py", line 207, in create_directory_tree
    tree_bytes = subprocess.check_output(["tree", "-n", repo_path])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,

  File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1917, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)

FileNotFoundError: [Errno 2] No such file or directory: 'tree'

Thank you for bringing this to my attention! I've implemented error handling to prevent this error from crashing the program.

To utilize this functionality in your README, it is necessary to have 'tree' installed on your computer.

Follow the installation instructions below based on your operating system:
- Linux: run 'apt-get install tree' in the terminal.
- MacOS: run 'brew install tree' in the terminal.
- Windows: run 'tree /F' in the command prompt.

Please inform me if you are able to successfully use the feature! Also see you have a connection to 🇱🇧 I'm half Lebanese myself, cheers!