What this thread does
ValueError: Directory {input_dir} does not exist.
LlamaIndex SimpleDirectoryReader rejects the directory before loading any documents.
First action — run from pathlib import Path; print(Path.cwd(), Path("data").resolve(), Path("data").is_dir()) in the failing Python process for a local directory.
Evidence status — official reader code distinguishes a failed directory check from an empty scan; recursion is documented for nested files, but no universal missing-directory repair is established.
Not for: LlamaIndex provider ImportError, Unknown model or workflow/vector errors; see llamaindex-importerror-unknown-model-workflow-vector-errors.
How to diagnose the reader
1. Check the resolved path and whether it is a directory in the process that raises the error. The opening message concretely substitutes data into Directory {input_dir} does not exist. 2. The official reader implementation raises that message when self.fs.isdir(input_dir) fails (main checked 2026-10-28). Compare the actual intended directory with the value passed. This check identifies the failing condition, not why the reader's filesystem cannot see that location. 3. If the directory exists and the error is instead ValueError: No files found in data., inspect where the files actually live. The official reader guide documents top-level-only loading by default and recursive=True for subdirectories (checked 2026-10-28):
from llama_index.core import SimpleDirectoryReader
reader = SimpleDirectoryReader(input_dir="data", recursive=True)
print(reader.input_files)
# Load only after confirming the expected files were selected.
documents = reader.load_data()
4. If recursion still finds nothing, inspect required_exts, exclude, exclude_hidden and exclude_empty. Check the actual paths against these settings. The source can discard files before producing the no-files message; adding recursion does not override filters. 5. For a known file, the guide also documents input_files=["path/to/file1", "path/to/file2"]. Use actual intended files to isolate directory discovery from file loading; do not create an empty directory merely to suppress the first exception.
Diagnostic: No files found in data.
This concretely substitutes data into No files found in {input_dir}. The source raises it when the selected file set is empty. That is different from the earlier directory check and from parsing, embeddings or vector-index construction.
What to test
- Run the path diagnostic from the same working directory as the failing program.
- Confirm a known top-level file appears in
reader.input_files, then a known nested file with recursion enabled. - Reapply intended extension and exclusion settings and check the selected paths again before loading.
Public evidence
- rgaesspi, issue #12181, 2024-03-22 (checked 2026-10-28), reports “No files found in data.” despite being able to list the directory. This is a historical failure report, not proof that a reader upgrade or recursion fixes every instance.
- alalalbert, issue #12585, 2024-04-04 (checked 2026-10-28), reports “Recursive use of SimpleDirectoryReader doesn't find files”. The example already sets
recursive=True, selects EPUB files and uses a dot-prefixed directory. It shows why recursion alone is not enough to diagnose selection; it does not establish a confirmed fix for the report.
Pitfalls
A relative directory depends on the process's working directory. Extension filters and exclusions can leave an existing directory with no selected files. Hidden-path exclusion is enabled by default in the linked main source (checked 2026-10-28). A successful scan does not prove a file parser or embedding provider will work.
A prompt for your agent
Read the linked official reader source and guide before changing configuration; do not infer a cause from an older tutorial. Distinguish the directory check from an empty selected file set. Show the local resolved path, intended files, recursion and filters. Propose the smallest change justified by those observations, then verify input_files before loading documents. Do not change model or vector-store settings to fix file discovery.
Limits
No local dataset, file parser or index was exercised here. Source scope is llama-index-core main (checked 2026-10-28), not a claimed stable-release reproduction. The public reports are historical and do not confirm a current regression. Remote filesystems require their own visibility checks; local pathlib output does not test those backends.
Started from a post by @run-llama, packaged by the editor. Original post