pandas>=1.0) into a concrete list of pinned package versions.
When Resolution Happens
Metaflow resolves environments in two scenarios:Automatic Resolution
Environments are automatically resolved:python myflow.py --environment=conda argo-workflows create
python myflow.py --environment=conda step-functions create
Manual Resolution
You can manually resolve environments using CLI commands:- From Flow
- From Requirements File
- From Environment File
Resolve all environments in a flow:
Understanding Environment IDs
Each environment has two identifiers:Requirement ID (req_id)
A hash of your user-specified requirements:- Package names and version constraints
- Python version constraint
- Channels or sources
Full ID (full_id)
A hash of all resolved packages with exact versions:- Every conda package installed
- Every pypi package installed
- Exact version numbers
Multiple full_ids can exist for the same req_id if you resolve at different times (as new package versions become available).
Default Environments
For eachreq_id, Metaflow maintains a default environment:
What is a default environment?
What is a default environment?
The default environment is the latest locally resolved environment for a given req_id. When you run a flow, Metaflow uses the default environment unless you force re-resolution.
Why default environments?
Why default environments?
Default environments prevent unnecessary re-resolution. If you run the same flow twice, the second run uses the same environment as the first, ensuring reproducibility.
When is a new default created?
When is a new default created?
A new default is created when:
- You force re-resolution with
--force - You resolve on a new machine that doesn’t have the environment locally
- The requirement ID changes (different dependencies)
Forcing Re-Resolution
By default, Metaflow reuses previously resolved environments. To force re-resolution:Using Flow Command
Using Metaflow Command
Resolution Process
Resolution Across Architectures
You can resolve environments for multiple architectures simultaneously:- Develop on Mac (osx-arm64)
- Deploy to Linux servers (linux-64)
- Ensure environment consistency across platforms
Supported architectures:
linux-64, osx-64, osx-arm64Using Remote Resolved Environments
By default, Metaflow only uses locally resolved environments. You can configure it to check for remotely resolved environments:Configuration Options
SetMETAFLOW_CONDA_USE_REMOTE_LATEST to:
- :none:
- :username:
- :any:
- user1,user2
Default behavior: Never use remote environments. Always re-resolve if not known locally.
Resolution Restrictions
Be aware of these limitations when resolving environments:PyPI Packages
Packages from:- Git repositories
- Local directories
- Source-only distributions
Mixed Mode
Environment Markers
Viewing Resolved Environments
After resolution, inspect what was resolved:For a Flow
For a Specific Step
For a Named Environment
- Environment type (conda-only, pypi-only, mixed)
- Requirement and full IDs
- Resolution date and user
- All installed packages with versions
- Local presence status
Caching After Resolution
After resolving, Metaflow caches:Caching enables faster environment creation on remote nodes and sharing environments across team members.
Next Steps
Named Environments
Create and share named environments
CLI Reference
Explore all environment commands
Configuration
Configure resolution behavior
Troubleshooting
Debug resolution issues
