Skip to content

Conan2 python api call/methods

CommandFunctions CalledDescription
conan export(none)Copies the recipe (conanfile.py) into the local Conan cache. Used to make a recipe available locally without building anything. Useful when other packages depend on this recipe via requires.
conan installlayout(), generate()Resolves and installs dependencies, then generates the files needed by the build system (e.g. toolchain, cmake presets). Typically the first step in a local development workflow.
conan buildlayout(), build()Runs the build step defined in build() (e.g. CMake build). Requires a prior conan install to have generated the necessary files. Does not package or export anything.
conan export-pkglayout(), package()Packages an already-built project into the local Conan cache by running package(). Useful for iterating on the packaging step without rebuilding from scratch.
conan createsource(), layout(), generate(), build(), package(), package_info()Runs the full pipeline: fetches sources, builds, packages, and stores the result in the local cache. The standard command for producing a ready-to-consume package.