ESPAsyncWebServer library update fails: FileNotFoundError: [WinError 2] The system cannot find the file specified

Hi all,

I have a project with the ESPAsyncWebServer library installed, via that link. However, when running pio lib update or using the GUI it fails with the below error log (personal info removed). Disabling Windows Defender doesn’t help, and platformio and pip are running the latest versions.

I’ve checked the solutions here and they haven’t helped. I also ran VSCode as admin, which also didn’t help. Any ideas what causes this?

PS %userprofile%\OneDrive\Documents\PlatformIO\Projects\Dagans Clock - Software> pio lib update
Library Storage: %userprofile%\OneDrive\Documents\PlatformIO\Projects\[REDACTED]\.pio\libdeps\esp8266
Updating git+ 1.2.3+sha.f6fff3f                  Error: Traceback (most recent call last):
  File "%userprofile%\.platformio\penv\lib\site-packages\platformio\", line 109, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "%userprofile%\.platformio\penv\lib\site-packages\click\", line 829, in __call__
    return self.main(*args, **kwargs)
  File "%userprofile%\.platformio\penv\lib\site-packages\click\", line 782, in main
    rv = self.invoke(ctx)
  File "%userprofile%\.platformio\penv\lib\site-packages\platformio\commands\", line 44, in invoke
    return super(PlatformioCLI, self).invoke(ctx)
  File "%userprofile%\.platformio\penv\lib\site-packages\click\", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "%userprofile%\.platformio\penv\lib\site-packages\click\", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "%userprofile%\.platformio\penv\lib\site-packages\click\", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "%userprofile%\.platformio\penv\lib\site-packages\click\", line 610, in invoke
    return callback(*args, **kwargs)
  File "%userprofile%\.platformio\penv\lib\site-packages\click\", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "%userprofile%\.platformio\penv\lib\site-packages\platformio\commands\lib\", line 280, in lib_update
  File "%userprofile%\.platformio\penv\lib\site-packages\platformio\package\manager\", line 108, in update
    outdated = self.outdated(pkg, to_spec)
  File "%userprofile%\.platformio\penv\lib\site-packages\platformio\package\manager\", line 46, in outdated
    latest = self._fetch_vcs_latest_version(pkg)
  File "%userprofile%\.platformio\penv\lib\site-packages\platformio\package\manager\", line 69, in _fetch_vcs_latest_version
    vcs =, pkg.metadata.spec.url, silent=True)
  File "%userprofile%\.platformio\penv\lib\site-packages\platformio\package\", line 54, in new
    obj = getattr(sys.modules[__name__], "%sClient" % type_.title())(
  File "%userprofile%\.platformio\penv\lib\site-packages\platformio\package\", line 137, in __init__
  File "%userprofile%\.platformio\penv\lib\site-packages\platformio\package\", line 146, in configure
    result = proc.exec_command([cls.command, "--exec-path"])
  File "%userprofile%\.platformio\penv\lib\site-packages\platformio\", line 117, in exec_command
    p = subprocess.Popen(*args, **kwargs)
  File "%userprofile%\.platformio\python3\lib\", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "%userprofile%\.platformio\python3\lib\", line 1420, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified


An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section

* Report this problem to the developers


A failure in that code path is almost always due to not having git installed globally.

That was it. I had a git installation, but it wasn’t on PATH or configured properly due to a PC switch.