Skip to content

@conda decorator cannot resolve #910

@kgullikson88

Description

@kgullikson88

I am trying to write a Flow using the @conda and @conda_base decorators, and am getting package conflicts that are surprising to me. Minimal example flow:

from metaflow import (
    FlowSpec,
    step,
    conda,
    conda_base,
)

@conda_base(python='3.9.9', libraries={'pandas': '1.3.3'})
class CondaFlow(FlowSpec):
    @conda(libraries={"pyyaml": "6.0"})
    @step
    def start(self):
        self.next(self.end)

    @step
    def end(self):
        pass


if __name__ == "__main__":
    CondaFlow()

My understanding is that this should be effectively equivalent to

conda create -n test python=3.9.9 pandas=1.3.3 pyyaml=6.0

which does resolve. However, when I run the flow using

python conda_flow.py --environment=conda run

I get the following output:

Long Error Message...

Metaflow 2.4.8 executing CondaFlow for user:kgullikson
Validating your flow...
    The graph looks good!
Running pylint...
    Pylint is happy!
Bootstrapping conda environment...(this could take a few minutes)
    Conda ran into an error while setting up environment.:
    Step: start, Error: UnsatisfiableError: The following specifications were found to be incompatible with each other:

    Output in format: Requested package -> Available versions

    Package ca-certificates conflicts for:
    coverage==4.5.4 -> python[version='>=2.7,<2.8.0a0'] -> ca-certificates
    boto3==1.14.47 -> python -> ca-certificates
    python==3.9.9 -> openssl[version='>=3.0.0,<4.0a0'] -> ca-certificates
    click==7.1.2 -> python -> ca-certificates
    requests==2.24.0 -> python -> ca-certificates

    Package pypy3.6 conflicts for:
    requests==2.24.0 -> certifi[version='>=2017.4.17'] -> pypy3.6[version='7.3.0.|7.3.1.|7.3.2.|7.3.3.|>=7.3.1|>=7.3.2|>=7.3.3']
    pandas==1.3.3 -> numpy[version='>=1.19.5,<2.0a0'] -> pypy3.6[version='>=7.3.1|>=7.3.2|>=7.3.3']
    coverage==4.5.4 -> python[version='>=3.6,<3.7.0a0'] -> pypy3.6[version='7.3.0.|7.3.1.|7.3.2.|7.3.3.']
    click==7.1.2 -> python -> pypy3.6[version='7.3.0.|7.3.1.|7.3.2.|7.3.3.']
    boto3==1.14.47 -> python -> pypy3.6[version='7.3.0.|7.3.1.|7.3.2.|7.3.3.|>=7.3.2']

    Package python conflicts for:
    requests==2.24.0 -> certifi[version='>=2017.4.17'] -> python[version='2.7.|3.5.|3.6.|>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0|<4.0']
    coverage==4.5.4 -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0']
    pyyaml==6.0 -> python[version='>=3.10,<3.11.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0']
    click==7.1.2 -> python
    python==3.9.9
    boto3==1.14.47 -> jmespath[version='>=0.7.1,<1.0.0'] -> python[version='2.7.|3.5.|3.6.|3.4.|>=3.5,<3.6.0a0|>=2.7,<2.8.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0|>=3|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0']
    boto3==1.14.47 -> python
    pyyaml==6.0 -> python_abi=3.7[build=_cp37m] -> python[version='3.10.|3.7.|3.8.|3.9.']
    requests==2.24.0 -> python

    Package python_abi conflicts for:
    pyyaml==6.0 -> python_abi[version='3.10.|3.7.|3.8.|3.9.|3.7',build='_cp37m|_cp310|_cp38|_cp39|_pypy37_pp73']
    coverage==4.5.4 -> python[version='>=3.6,<3.7.0a0'] -> python_abi[version='3.6|3.7',build='_pypy37_pp73|_pypy36_pp73']
    click==7.1.2 -> python -> python_abi[version='3.6|3.7',build='_pypy37_pp73|_pypy36_pp73']
    boto3==1.14.47 -> python -> python_abi[version='3.6.|3.6|3.7|3.7.|3.9.|3.8.',build='_cp38|_pypy37_pp73|_pypy36_pp73|_cp37m|_cp39|_cp36m']
    requests==2.24.0 -> certifi[version='>=2017.4.17'] -> python_abi[version='2.7.|3.10.|3.9.|3.8.|3.7.|3.7|3.6.|3.6',build='_pypy37_pp73|_cp39|_cp310|_cp38|_cp37m|_cp36m|_pypy36_pp73|_cp27m']
    pandas==1.3.3 -> numpy[version='>=1.19.5,<2.0a0'] -> python_abi[version='3.10.|3.6.|3.6',build='_cp310|_cp36m|_pypy36_pp73']
    pandas==1.3.3 -> python_abi[version='3.7.|3.7|3.8.|3.9.',build='_cp39|_pypy37_pp73|_cp38|_cp37m']

    Package tzdata conflicts for:
    pandas==1.3.3 -> python[version='>=3.9,<3.10.0a0'] -> tzdata
    pyyaml==6.0 -> python[version='>=3.10,<3.11.0a0'] -> tzdata
    python==3.9.9 -> tzdata
    click==7.1.2 -> python -> tzdata
    requests==2.24.0 -> python -> tzdata
    boto3==1.14.47 -> python -> tzdata

    Package python-dateutil conflicts for:
    boto3==1.14.47 -> botocore[version='>=1.17.47,<1.18.0'] -> python-dateutil[version='>=2.1,<3.0.0']
    pandas==1.3.3 -> python-dateutil[version='>=2.7.3']

    Package certifi conflicts for:
    requests==2.24.0 -> urllib3[version='>=1.21.1,<1.26,!=1.25.0,!=1.25.1'] -> certifi
    requests==2.24.0 -> certifi[version='>=2017.4.17']
    pandas==1.3.3 -> setuptools[version='<60.0.0'] -> certifi[version='>=2016.09|>=2016.9.26']

    Package gdbm conflicts for:
    pyyaml==6.0 -> pypy3.7[version='>=7.3.7'] -> gdbm[version='>=1.18,<1.19.0a0']
    pandas==1.3.3 -> pypy3.7[version='>=7.3.5'] -> gdbm[version='>=1.18,<1.19.0a0']

    Package pypy3.7 conflicts for:
    pyyaml==6.0 -> python[version='>=3.7,<3.8.0a0'] -> pypy3.7[version='7.3.|7.3.3.|7.3.4.|7.3.5.|7.3.7.']
    pyyaml==6.0 -> pypy3.7[version='>=7.3.5|>=7.3.7']

    Package setuptools conflicts for:
    pandas==1.3.3 -> numexpr[version='>=2.7.0'] -> setuptools
    python==3.9.9 -> pip -> setuptools
    pandas==1.3.3 -> setuptools[version='<60.0.0']

    Package urllib3 conflicts for:
    requests==2.24.0 -> urllib3[version='>=1.21.1,<1.26,!=1.25.0,!=1.25.1']
    boto3==1.14.47 -> botocore[version='>=1.17.47,<1.18.0'] -> urllib3[version='>=1.20,<1.26']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions