Skip to content
Latchkey

Conan "conanfile.txt not found" in CI

Conan looked in the current directory for a conanfile.txt or conanfile.py and found neither. In CI this is almost always a wrong working directory, a path typo, or a file that was not checked out.

What this error means

conan install fails immediately with "ERROR: Conanfile not found, in <path>". No dependency is even attempted because there is nothing to read.

Conan
ERROR: Conanfile not found, in /home/runner/work/app/app
It should be one of: conanfile.py, conanfile.txt

Common causes

The step runs from the wrong directory

The conanfile lives in a subdirectory (for example cpp/), but the step calls conan install . from the repo root where no conanfile exists.

The file was not checked out or is git-ignored

A sparse or shallow checkout, or a conanfile left out of version control, means the file is absent on the runner.

How to fix it

Point conan at the conanfile directory

Pass the directory (or file) that actually contains the conanfile.

Terminal
conan install cpp/ --build=missing
# or run from that directory
conan install path/to/conanfile.txt

Confirm the file is present on the runner

  1. Add a ls of the expected directory before the conan step to verify the file exists.
  2. Ensure the checkout includes the conanfile (no sparse-checkout exclusion).
  3. Set the step working-directory to the folder that holds the conanfile.
.github/workflows/ci.yml
- run: conan install .
  working-directory: cpp

How to prevent it

  • Set an explicit working-directory for the conan step.
  • Verify the conanfile is committed and not excluded by sparse checkout.
  • Reference the conanfile path directly rather than relying on the current directory.

Frequently asked questions

What causes ""conanfile.txt not found""?
The conanfile lives in a subdirectory (for example cpp/), but the step calls conan install . from the repo root where no conanfile exists.
How do I fix "conanfile.txt not found"?
Pass the directory (or file) that actually contains the conanfile.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card