﻿# Metaflow remote packaging: installed libraries do not include every local prompt or SQL file

Diagnose remote Metaflow file-not-found errors by separating packaged source, non-Python assets, installed dependencies and remote filesystem paths.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-metaflow-code-package-non-python-file-dependency/
Language: en

## The import succeeds but the prompt is missing

A local evaluation imports its helper module and reads a prompt template beside that module. The remote task imports the helper successfully yet fails when opening the template. Installing the same Python library versions did not guarantee that every project file was shipped with the flow.

Classify the missing object before changing the container. Is it source code, an embedded project asset, a separately managed dataset or a path meaningful only on the developer's laptop? These categories require different transport and identity decisions.

## Inspect the code package

The [project structure guide](https://docs.metaflow.org/scaling/dependencies/project-structure) explains the default Python-file packaging scope and how to include non-Python suffixes. It also provides package inspection commands. Use the actual package listing as evidence instead of assuming the local project directory is copied wholesale.

For the prompt template, declare its inclusion intentionally and verify its relative location in the package. Avoid depending on the developer's absolute home-directory path: a remote layout is not guaranteed to reproduce that machine's filesystem root.

## Distinguish installation from project assets

The [library management guide](https://docs.metaflow.org/scaling/dependencies/libraries) explains isolated environments and third-party dependency declarations. Those declarations make libraries available; they do not automatically turn arbitrary adjacent text files into tracked inputs. Keep the application's dependency inventory explicit.

A prompt used to generate evaluation labels deserves an identity as well as a path. Tie it to the evaluation record, especially if changing the wording can change the target behavior. [Annotation taxonomy mapping](/journal/data-guide-label-taxonomy-version-mapping/) similarly distinguishes semantic changes from file availability.

## Keep package sources and data references separate

The [pypi decorator reference](https://docs.metaflow.org/api/step-decorators/pypi) describes step-level package declarations. Use them for installable dependencies. Large or independently versioned input data may belong in a managed artifact location rather than being accidentally bundled into source distribution.

For an SQL file, shipping the query text still does not snapshot the database it reads. For a prompt template, shipping the template does not identify the model revision that interprets it. Preserve each dependency at its own boundary.

## Validate from a clean execution context

Inspect the package and run a small remote task that opens the expected relative asset path. Record the asset identity and a recognizable expected value without depending on unrelated local files.

Finally connect model-side assets with an [artifact manifest](/journal/tokenizer-artifact-release-manifest/). A reproducible evaluation needs the intended files and libraries together, but observing one successful import is not proof that all those dependencies reached the task.
