metaflow environment command allows you to resolve, create, inspect, and share Conda-based environments.
Synopsis
Global Options
Suppress unnecessary messages
Metadata service type. Available options:
local, serviceDatastore type. Available options:
s3, localType of environment to manage. Currently only
conda is supportedRoot path for Conda cached information. If not set, looks for
METAFLOW_CONDA_S3ROOT (for S3)Commands
metaflow environment resolve
Resolve an environment from dependency specifications.Options
Alias the resolved environment. Can be specified multiple times. Format:
name or name:tagForce resolution of already resolved environments
Only look locally for using environments
Dry-run — only resolve, do not download, cache, persist or alias anything
Set the resolved environment as the default environment for this set of requirements
Architecture to resolve for. Can be specified multiple times. If not specified, defaults to current machine architecture
Python version for the environment. Defaults to current version. Example:
">=3.8,<3.9"Get the environment definition from a requirements.txt file (pip format)
Get the environment definition from a environment.yml file (conda-lock format)
Get the environment definition from a pyproject.toml file (poetry format)
Environment created starting with the environment for the Pathspec specified
Environment created starting with the environment referenced here
Environment created cloning the requirements in the Pathspec specified
Environment created cloning the requirements in the environment referenced here
Examples
Resolve an environment from a requirements.txt file:metaflow environment create
Create a local environment based on an environment specification.Arguments
Environment identifier. Can be:
- A pathspec:
<flowname>/<runid>/<stepname> - A partial hash:
<req id>(assumes default environment) - A full hash:
<req id>:<full id>or<full-id> - An alias name: as added using
--aliaswhen resolving
Options
Name of the environment to create
Only create if environment is known locally
Recreate the environment if it already exists and remove the
--into-dir directory if it existsIf True, fails if it cannot install the original Metaflow environment
If the
env-name refers to a Metaflow executed Step, downloads the step’s code package into this directoryInstall the created environment as a Jupyter kernel. Requires
--nameThe environment name given is a pathspec
Examples
Create an environment with a Jupyter kernel:metaflow environment get
Locally fetch an environment already resolved and present remotely.Arguments
Environment identifier (pathspec, hash, or alias name)
Options
Set the downloaded environment as default for its requirement ID
Request this architecture. Defaults to current architecture if not specified
The environment name given is a pathspec
Examples
Fetch a named environment:metaflow environment show
Show information about an environment.Arguments
One or more environment identifiers (pathspec, hash, or alias name)
Options
Only resolve source env using local information
Show environment for this architecture
The environments given are pathspecs
Examples
Show environment from a pathspec:metaflow environment alias
Alias an existing environment.Arguments
Source environment identifier
Alias name to assign. Format:
name or name:tagOptions
Only resolve source env using local information
The source environment given is a pathspec
Examples
Alias an environment:Related Commands
- metaflow debug task - Debug tasks with specific environments
See Also
- Managing Dependencies Documentation - Learn about @conda, @pypi, and @named_env decorators
