compile of app fails with FileNotFoundError: [Errno 2] No such file or directory: 'git' (IDF-10003)

atx823
Posts: 13
Joined: Fri Jan 07, 2022 6:51 pm

compile of app fails with FileNotFoundError: [Errno 2] No such file or directory: 'git' (IDF-10003)

Postby atx823 » Mon May 20, 2024 1:47 am

This is with a new install of v5.1.1 on a new install of linux mint 21.3. The install of v5.1.1 went fine the second time after I manually installed python3.10-venv. v5.1.1 works fine on another system I have running mint 20.3.

Code: Select all

WARNING: Git was not found
WARNING: Git was not found
WARNING: Git was not found
WARNING: Git was not found
WARNING: Git was not found
WARNING: Git was not found
WARNING: Git was not found
WARNING: Git was not found
WARNING: Git was not found
Checking Python dependencies...
Python requirements are satisfied.
Constraint file: /home/eccles/.espressif/espidf.constraints.v5.1.txt
Requirement files:
 - /home/eccles/esp/esp-idf-v5.1.1/tools/requirements/requirements.core.txt
Python being checked: /home/eccles/.espressif/python_env/idf5.1_py3.10_env/bin/python
Executing action: app
Traceback (most recent call last):
  File "/home/eccles/esp/esp-idf-v5.1.1/tools/idf.py", line 773, in <module>
    main()
  File "/home/eccles/esp/esp-idf-v5.1.1/tools/idf.py", line 708, in main
    cli(sys.argv[1:], prog_name=PROG, complete_var=SHELL_COMPLETE_VAR)
  File "/home/eccles/.espressif/python_env/idf5.1_py3.10_env/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/eccles/.espressif/python_env/idf5.1_py3.10_env/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/eccles/.espressif/python_env/idf5.1_py3.10_env/lib/python3.10/site-packages/click/core.py", line 1720, in invoke
    return _process_result(rv)
  File "/home/eccles/.espressif/python_env/idf5.1_py3.10_env/lib/python3.10/site-packages/click/core.py", line 1657, in _process_result
    value = ctx.invoke(self._result_callback, value, **ctx.params)
  File "/home/eccles/.espressif/python_env/idf5.1_py3.10_env/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/eccles/esp/esp-idf-v5.1.1/tools/idf.py", line 605, in execute_tasks
    task(ctx, global_args, task.action_args)
  File "/home/eccles/esp/esp-idf-v5.1.1/tools/idf.py", line 187, in __call__
    self.callback(self.name, context, global_args, **action_args)
  File "/home/eccles/esp/esp-idf-v5.1.1/tools/idf_py_actions/core_ext.py", line 33, in build_target
    ensure_build_directory(args, ctx.info_name)
  File "/home/eccles/esp/esp-idf-v5.1.1/tools/idf_py_actions/tools.py", line 471, in ensure_build_directory
    debug_print_idf_version()
  File "/home/eccles/esp/esp-idf-v5.1.1/tools/idf_py_actions/tools.py", line 134, in debug_print_idf_version
    print_warning(f'ESP-IDF {idf_version() or "version unknown"}')
  File "/home/eccles/esp/esp-idf-v5.1.1/tools/idf_py_actions/tools.py", line 70, in idf_version
    version: Optional[str] = subprocess.check_output([
  File "/usr/lib/python3.10/subprocess.py", line 421, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.10/subprocess.py", line 503, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'git'
I've been using esp-idf for years without git -- I just download the zip file.

Any assistance will be much appreciated.

User avatar
ESP_Roland
Posts: 263
Joined: Tue Oct 09, 2018 10:28 am

Re: compile of app fails with FileNotFoundError: [Errno 2] No such file or directory: 'git'

Postby ESP_Roland » Mon May 20, 2024 7:01 am

Please try v5.1.4 which is currently the latest bugfix release of v5.1 and report back if the issue still exists. If my memories are correct then this has already been fixed.

atx823
Posts: 13
Joined: Fri Jan 07, 2022 6:51 pm

Re: compile of app fails with FileNotFoundError: [Errno 2] No such file or directory: 'git'

Postby atx823 » Mon May 20, 2024 8:11 pm

Same error with 5.1.4.

I installed git from the mint software manager, and then idf.py complained about cmake not being on the path. So I installed cmake as well and now compilation works.

Cmake is listed in the esp-idf docs as a prerequisite, but git is not.

Thanks very much for your help.

User avatar
ESP_Roland
Posts: 263
Joined: Tue Oct 09, 2018 10:28 am

Re: compile of app fails with FileNotFoundError: [Errno 2] No such file or directory: 'git' (IDF-10003)

Postby ESP_Roland » Tue May 21, 2024 10:33 am

Git is not required. It was only an optional dependency. Recently we've removed it from some parts of ESP-IDF but we forgot about this. This will be addressed soon.

The issue you are facing is with your Python. Somehow it throws a different exception as we've anticipated. You can patch your version by adding FileNotFoundError here: https://github.com/espressif/esp-idf/bl ... ols.py#L76. So it will be:

Code: Select all

except (subprocess.CalledProcessError, UnicodeError, FileNotFoundError):
In the next bugfix release we'll remove the check entirely.

Who is online

Users browsing this forum: Majestic-12 [Bot] and 70 guests