Git lfs error for app

I’m using a repo to build App on HF, but when it runs it always report the following error:

Traceback (most recent call last):
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/", line 742, in clone_from
    run_subprocess("git lfs install", self.local_dir)
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/utils/", line 61, in run_subprocess
  File "/usr/local/lib/python3.8/", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'lfs', 'install']' returned non-zero exit status 2.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 349, in 
    demo = build_interface()
  File "", line 335, in build_interface
    callback.setup([user_choice, left, right], "flagged_data_points")
  File "/home/user/app/", line 342, in setup
    self.repo = huggingface_hub.Repository(
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/utils/", line 101, in inner_f
    return f(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/utils/", line 124, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/", line 528, in __init__
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/utils/", line 124, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/", line 797, in clone_from
    raise EnvironmentError(exc.stderr)
OSError: Hook already exists: post-checkout

	command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting '.git/hooks/post-checkout'.\n"; exit 2; }
	git lfs post-checkout "$@"

To resolve this, either:
  1: run `git lfs update --manual` for instructions on how to merge hooks.
  2: run `git lfs update --force` to overwrite your hook.

Any idea on how to solve this?


1 Like


I have the exact same issue with my space. Did you find a solution ?


No solution on this for now. I just use my own server instead of HF server to build the app.

1 Like