Hi, Facing the below error: ```Metaflow 2.12.20+ne...
# ask-metaflow
h
Hi, Facing the below error:
Copy code
Metaflow 2.12.20+netflix-ext(1.2.2) executing CombinedBELModelFlow for user:gauravmudbhatkal
Validating your flow...
  The graph looks good!
Bootstrapping Conda environment... (this could take a few minutes)
Pretty-printed STDERR:
ERROR: Ignored the following versions that require a different python version: 8.19.0 Requires-Python >=3.10; 8.20.0 Requires-Python >=3.10; 8.21.0 Requires-Python >=3.10; 8.22.0 Requires-Python >=3.10; 8.22.1 Requires-Python >=3.10; 8.22.2 Requires-Python >=3.10; 8.23.0 Requires-Python >=3.10; 8.24.0 Requires-Python >=3.10; 8.25.0 Requires-Python >=3.10; 8.26.0 Requires-Python >=3.10; 8.27.0 Requires-Python >=3.10
ERROR: Could not find a version that satisfies the requirement pyod>=1.1.3 (from pycaret) (from versions: none)
ERROR: No matching distribution found for pyod>=1.1.3
Using the latest version of metaflow & metaflow netflix extension.
Copy code
@pypi_base(
    packages={
        "sentence-transformers": "3.0.1",
        "matplotlib": "",
        "pandas": "1.5.3",
        "numpy": "",
        "psycopg2-binary": "2.9.9",
        "transformers": "4.41.2",
        "tensorflow": "2.11.0",
        "pycaret": "3.3.2",
        "torch": "",
        "scikit-learn": "",
        "seaborn": "0.13.2",
    },
    python="3.9.13",
)
class MLModelFlow(DBMixin, Config, FlowSpec):
      ....
FYI - Using micromamba
1
d
Sorry for the delay. I tried your environment and it seems to work ok. I get this:
Copy code
Environment of type pypi-only full hash 0a30699962bc110cda178213e3a5dd85552d7c0e:88c4eaade6b24ad988b35d30712edf0a203fb4aa
Arch linux-64
Available on linux-64

Resolved on 2024-09-24 22:01:05.289297
Resolved by rcledat

User-requested packages sys::__glibc==2.35=0, pypi::boto3==>=1.14.0, pypi::cffi==>=1.13.0,!=1.15.0, pypi::fastavro==>=1.6.0, pypi::ipykernel, pypi::matplotlib, pypi::numpy, pypi::pandas==>=0.24.0,==1.5.3, pypi::psycopg2-binary==2.9.9, pypi::pyarrow==>=0.17.1, pypi::pycaret==3.3.2, conda::python==3.9.13, pypi::requests==>=2.21.0, pypi::scikit-learn, pypi::seaborn==0.13.2, pypi::sentence-transformers==3.0.1, pypi::tensorflow==2.11, pypi::torch, pypi::transformers==4.41.2
User sources conda::conda-forge, pypi::<https://pypi.netflix.net/simple>

Conda Packages installed _libgcc_mutex==0.1-conda_forge, _openmp_mutex==4.5-2_gnu, bzip2==1.0.8-h4bc722e_7, ca-certificates==2024.8.30-hbcca054_0, ld_impl_linux-64==2.43-h712a8e2_0, libffi==3.4.2-h7f98852_5, libgcc==14.1.0-h77fa898_1, libgcc-ng==14.1.0-h69a702a_1, libgomp==14.1.0-h77fa898_1, libnsl==2.0.1-hd590300_0, libsqlite==3.46.1-hadc24fc_0, libuuid==2.38.1-h0b41bf4_0, libzlib==1.3.1-h4ab18f5_1, ncurses==6.5-he02047a_1, openssl==3.3.2-hb9d3cd8_0, pip==24.2-pyh8b19718_1, python==3.9.13-h2660328_0_cpython, readline==8.2-h8228510_1, setuptools==74.1.2-pyhd8ed1ab_0, sqlite==3.46.1-h9eae976_0, tk==8.6.13-noxft_h4845f30_101, tomli==2.0.1-pyhd8ed1ab_0, tzdata==2024a-h8827d51_1, wheel==0.42.0-pyhd8ed1ab_0, xz==5.2.6-h166bdaf_0
Pypi Packages installed absl-py==2.1.0, asttokens==2.4.1, astunparse==1.6.3, attrs==24.2.0, blinker==1.8.2, boto3==1.35.26, botocore==1.35.26, cachetools==5.5.0, category-encoders==2.6.3, certifi==2024.8.30, cffi==1.17.1, charset-normalizer==3.3.2, click==8.1.7, cloudpickle==3.0.0, comm==0.2.2, contourpy==1.3.0, cycler==0.12.1, cython==3.0.11, dash==2.18.1, dash-core-components==2.0.0, dash-html-components==2.0.0, dash-table==5.0.0, debugpy==1.8.6, decorator==5.1.1, deprecation==2.1.0, exceptiongroup==1.2.2, executing==2.1.0, fastavro==1.9.7, fastjsonschema==2.20.0, filelock==3.16.1, flask==3.0.3, flatbuffers==24.3.25, fonttools==4.54.1, fsspec==2024.9.0, gast==0.4.0, google-auth==2.35.0, google-auth-oauthlib==0.4.6, google-pasta==0.2.0, grpcio==1.66.1, h5py==3.11.0, huggingface-hub==0.25.1, idna==3.10, imbalanced-learn==0.12.3, importlib-metadata==8.5.0, importlib-resources==6.4.5, ipykernel==6.29.5, ipython==8.18.1, ipywidgets==8.1.5, itsdangerous==2.2.0, jedi==0.19.1, jinja2==3.1.4, jmespath==1.0.1, joblib==1.3.2, jsonschema==4.23.0, jsonschema-specifications==2023.12.1, jupyter-client==8.6.3, jupyter-core==5.7.2, jupyterlab-widgets==3.0.13, kaleido==0.2.1, keras==2.11.0, kiwisolver==1.4.7, libclang==18.1.1, lightgbm==4.5.0, llvmlite==0.43.0, markdown==3.7, markupsafe==2.1.5, matplotlib==3.7.5, matplotlib-inline==0.1.7, mpmath==1.3.0, nbformat==5.10.4, nest-asyncio==1.6.0, networkx==3.2.1, numba==0.60.0, numpy==1.26.4, nvidia-cublas-cu12==12.1.3.1, nvidia-cuda-cupti-cu12==12.1.105, nvidia-cuda-nvrtc-cu12==12.1.105, nvidia-cuda-runtime-cu12==12.1.105, nvidia-cudnn-cu12==9.1.0.70, nvidia-cufft-cu12==11.0.2.54, nvidia-curand-cu12==10.3.2.106, nvidia-cusolver-cu12==11.4.5.107, nvidia-cusparse-cu12==12.1.0.106, nvidia-nccl-cu12==2.20.5, nvidia-nvjitlink-cu12==12.6.68, nvidia-nvtx-cu12==12.1.105, oauthlib==3.2.2, opt-einsum==3.3.0, orjson==3.10.7, packaging==24.1, pandas==1.5.3, parso==0.8.4, patsy==0.5.6, pexpect==4.9.0, pillow==10.4.0, platformdirs==4.3.6, plotly==5.24.1, plotly-resampler==0.10.0, pmdarima==2.0.4, prompt-toolkit==3.0.47, protobuf==3.19.6, psutil==6.0.0, psycopg2-binary==2.9.9, ptyprocess==0.7.0, pure-eval==0.2.3, pyarrow==17.0.0, pyasn1==0.6.1, pyasn1-modules==0.4.1, pycaret==3.3.2, pycparser==2.22, pygments==2.18.0, pyod==2.0.2, pyparsing==3.1.4, python-dateutil==2.9.0.post0, pytz==2024.2, pyyaml==6.0.2, pyzmq==26.2.0, referencing==0.35.1, regex==2024.9.11, requests==2.32.3, requests-oauthlib==2.0.0, retrying==1.3.4, rpds-py==0.20.0, rsa==4.9, s3transfer==0.10.2, safetensors==0.4.5, schemdraw==0.15, scikit-base==0.7.8, scikit-learn==1.4.2, scikit-plot==0.3.7, scipy==1.11.4, seaborn==0.13.2, sentence-transformers==3.0.1, setuptools==75.1.0, six==1.16.0, sktime==0.26.0, stack-data==0.6.3, statsmodels==0.14.3, sympy==1.13.3, tbats==1.1.3, tenacity==9.0.0, tensorboard==2.11.2, tensorboard-data-server==0.6.1, tensorboard-plugin-wit==1.8.1, tensorflow==2.11.0, tensorflow-estimator==2.11.0, tensorflow-io-gcs-filesystem==0.37.1, termcolor==2.4.0, threadpoolctl==3.5.0, tokenizers==0.19.1, torch==2.4.1, tornado==6.4.1, tqdm==4.66.5, traitlets==5.14.3, transformers==4.41.2, triton==3.0.0, tsdownsample==0.1.3, typing-extensions==4.12.2, urllib3==1.26.20, wcwidth==0.2.13, werkzeug==3.0.4, wheel==0.44.0, widgetsnbextension==4.0.13, wrapt==1.16.0, wurlitzer==3.1.1, xxhash==3.5.0, yellowbrick==1.5, zipp==3.20.2

Dry-run -- not caching or aliasing
Could you try with METAFLOW_DEBUG_CONDA=1 and see what you get. Given these are just pypi dependencies, the error is coming from pip directly which is somehow not able to resolve your rquirements.
h
Here's the logs
d
ah — you are doing cross platform. Unfortunately, it won’t work because pyod does not have any wheels in pypi (and cross platform requires wheels only — this is a pip requirement). You have two solutions: • move to using a
@conda
decorator (briefly looking it looks like most packages are available there) • using a separate node to build your environment (ie: build it in batch). Let me find you a thread for that second option
h
Thanks @dry-beach-38304, will look into it.
Not a followup of the above error exactly, but a flow which was working earlier seems to be failing. Im running on fedora40.
Copy code
@conda_base(
    python="3.9.0",
    libraries={
        "joblib": "1.2.0",
        "matplotlib": "",
        "numpy": "1.24.0",
        "pandas": "1.5.3",
        "pillow": "10.1.0",
        "psycopg2-binary": "2.9.9",
        "requests": "2.31.0",
        "seaborn": "0.11.2",
        "pytorch": "",
        "transformers": "4.41.2",
        "xgboost": "2.0.3",
        "pydantic": "2.5.3",
        "urllib3": "1.26.18",
        "pydantic-settings": "2.1.0",
        "jsonschema": "4.22.0",
        "pycaret": "3.3.1",
        "sqlalchemy": "2.0.28",
        "nltk": "3.8.1",
        "spacy": "3.7.4",
        "sentence-transformers": "3.0.1",
        "alembic": "1.13.1",
        "conda-forge::pgvector-python": "0.2.5",
        "fastapi": "",
        "langchain": "0.2.5",
        "langchain-openai": "0.1.17",
        "openai-clip": "1.0.1",
    },
    channels=["conda-forge", "defaults"],
)
class Flow.....
Error:
Copy code
Metaflow 2.12.22+netflix-ext(1.2.2) executing BulkRapidForecastTestingFlow for user:sln
Validating your flow...
    The graph looks good!
Bootstrapping Conda environment... (this could take a few minutes)
    Resolving 1 environment ...No STDOUT
Pretty-printed STDERR:
critical libmamba Error parsing version ">=1.14.0". Version contains invalid characters in >=1.14.0.

    Conda ran into an error while setting up environment.:
    Conda command '['/home/sln/.local/bin/micromamba', 'create', '--yes', '--prefix', '/tmp/tmp2qwmb5qw/prefix', '--dry-run', '-c', 'defaults', 'langchain-openai==0.1.17', 'pytorch', 'sentence-transformers==3.0.1', 'pydantic==2.5.3', 'boto3==>=1.14.0', 'jsonschema==4.22.0', 'nltk==3.8.1', 'openai-clip==1.0.1', 'pandas==1.5.3', 'pydantic-settings==2.1.0', 'transformers==4.41.2', 'joblib==1.2.0', 'urllib3==1.26.18', 'fastapi', 'sqlalchemy==2.0.28', 'seaborn==0.11.2', 'pycaret==3.3.1', 'alembic==1.13.1', 'python==3.9', 'numpy==1.24.0', 'xgboost==2.0.3', 'pillow==10.1.0', 'conda-forge::pgvector-python==0.2.5', 'psycopg2-binary==2.9.9', 'requests==2.31.0,>=2.21.0', 'langchain==0.2.5', 'matplotlib', 'spacy==3.7.4', '-r', '/home/sln/micromamba', '--json']' returned error (1); see pretty-printed error above
d
I suspect this is because this is micromamba 2.0? I think they changed the syntax they accept. I need to make a small change to fix it (ie not do ==>= which used to work but seems to no longer be accepted).
yes — micromamba 2.0.0 was released 18h ago.
I will do this with a matter of urgency then 🙂
if you go back to a slightly older version it should work fine
h
Yea, its 2.0. Re-installed micromamba completely as something got messed up and there's a new version of it 😅 Thanks for the help @dry-beach-38304. Will try to go back to the older version for now
d
I’ll update the code to fix this. I think it’s simply removing the ==. I do this for pypi already and will just need to do it here as well. I just want to test if that new format will work on the old micromamba and the new one. I’ll do that tomorrow hopefully. Shouldn’t be hard. Thanks for pointing this out.
🙌 1
thankyou 1
h
Is there a way to use
requirements.txt
or
environemt.yml
with a flow decorator instead of resolving and then using the namedenv? Something like:
Copy code
@conda_base(file="./env.yaml")
class Flow(FlowSpec):
     .....
d
this has been asked before and it’s not there yet but it should be out very soon. The plan will be to support it with something like this: https://github.com/Netflix/metaflow/pull/1962 and have a
Config
that defines your environment file and we will provide the parser method so you can then do something like:
Copy code
from metaflow import conda_base, Flow, Config

from metaflow.config_parsers import CondaYaml # exact syntax TBD)

@conda_base(**config_expr("env_spec"))
class Flow(FlowSpec):

  env_spec = Config("env_spec", default="./env.yaml", parser=CondaYaml)
I had an older PR internally as well that added a file= option like you mentioned but when I started working on the config, I figured it would be a better experience (and not introduce yet another option).
I am hoping this will come out shortly (at least to try). The PR is fully functional (doesn’t have the CondaYaml parser yet) and it’s getting reviewed.
h
Wow, this is amazing. Excited to try it out sometime.
Downgraded to micromamba version 1.5.10 and facing a different error:
Copy code
Metaflow 2.12.22+netflix-ext(1.2.2) executing BulkRapidForecastTestingFlow for user:sln
Validating your flow...
    The graph looks good!
Bootstrapping Conda environment... (this could take a few minutes)
    Resolving 1 environment ...Pretty-printed STDOUT:
{
    "solver_problems": [
        "package jsonschema-4.22.0-pyhd8ed1ab_0 is excluded by strict repo priority",
        "package numpy-1.24.0-py39hb10b683_0 is excluded by strict repo priority",
        "package pillow-10.1.0-py39hcf8a34e_0 is excluded by strict repo priority",
        "package sqlalchemy-2.0.28-py39hf860d4a_0 is excluded by strict repo priority",
        "package spacy-3.7.4-py39he5d7314_0 is excluded by strict repo priority",
        "package alembic-1.13.1-pyhd8ed1ab_1 is excluded by strict repo priority",
        "package langchain-openai-0.1.17-pyhd8ed1ab_0 requires tiktoken >=0.7,<1, but none of the providers can be installed",
        "nothing provides openssl >=3.2.0,<3.2.0a0 needed by libpq-15.4-hdb747bd_4",
        "package python-3.9.13-haa1d7c7_1 requires openssl >=1.1.1q,<1.1.2a, but none of the providers can be installed"
    ],
    "success": false
}

Pretty-printed STDERR:
critical libmamba Could not solve for environment specs

    Conda ran into an error while setting up environment.:
    Conda command '['/home/sln/.local/bin/micromamba', 'create', '--yes', '--prefix', '/tmp/tmp2urgrafd/prefix', '--dry-run', '-c', 'defaults', 'pydantic-settings==2.1.0', 'sqlalchemy==2.0.28', 'matplotlib', 'transformers==4.41.2', 'nltk==3.8.1', 'spacy==3.7.4', 'openai-clip==1.0.1', 'numpy==1.24.0', 'python==3.9.13', 'sentence-transformers==3.0.1', 'pydantic==2.5.3', 'boto3==>=1.14.0', 'jsonschema==4.22.0', 'pytorch', 'pandas==1.5.3', 'urllib3==1.26.18', 'pillow==10.1.0', 'joblib==1.2.0', 'langchain==0.2.5', 'langchain-openai==0.1.17', 'pgvector-python==0.2.5', 'pycaret==3.3.1', 'seaborn==0.11.2', 'xgboost==2.0.3', 'requests==2.31.0,>=2.21.0', 'psycopg2-binary==2.9.9', 'fastapi', 'alembic==1.13.1', '-r', '/home/sln/micromamba', '--json']' returned error (1); see pretty-printed error above
have configured to use micromamba
❯ export METAFLOW_CONDA_DEPENDENCY_RESOLVER=micromamba
If i switch to
pypi_base
it works fine, other team members who are on Mac, need to use
conda_base
. Any idea why this is happening? All are using micromamba locally.
d
does your configuration define a specific channel priority?
I’m going to try running it myself but that error seems to be coming from a strict priority in channels
it’s weird because: • micromamba by default assumes “flexible” (as far as I can tell) • the “-c” in the command line means that I also set an env var to set the channel priority to flexible.
h
This is how the channels are passed to the
conda_base
decorator.
channels=["conda-forge", "defaults"],
Not passing anything else in the cmd line
d
do you have any .condarc or anything else there?
h
Nope, havent set any.
did try to search for those. dint find any
d
could you try:
/home/sln/.local/bin/micromamba config list -a
and let me know what it says for the channel priority thing?
h
Its strict
channel_priority: strict
d
ah ha
h
Will try to disable it and try it out again.
micromamba config --set channel_priority false
Is it a default value or stored somewhere in some rc/config file?
d
I have it to
flexible
. I think micromamba can tell you where the configs are coming from.
By default as I mentioned I think it should be flexible.
h
Got the path. Changing to flexible. Thank you!
d
but this is great feedback — I would have thought that the env variable would override it but clearly not. If you get a chance (and have some time), I would appreciate if you could run a few of these commands and let me know what happens (with your old
strict
setting in your config): The base command is basically what is given here:
['/home/sln/.local/bin/micromamba', 'create', '--yes', '--prefix', '/tmp/tmp2urgrafd/prefix', '--dry-run', '-c', 'defaults', 'pydantic-settings==2.1.0', 'sqlalchemy==2.0.28', 'matplotlib', 'transformers==4.41.2', 'nltk==3.8.1', 'spacy==3.7.4', 'openai-clip==1.0.1', 'numpy==1.24.0', 'python==3.9.13', 'sentence-transformers==3.0.1', 'pydantic==2.5.3', 'boto3==>=1.14.0', 'jsonschema==4.22.0', 'pytorch', 'pandas==1.5.3', 'urllib3==1.26.18', 'pillow==10.1.0', 'joblib==1.2.0', 'langchain==0.2.5', 'langchain-openai==0.1.17', 'pgvector-python==0.2.5', 'pycaret==3.3.1', 'seaborn==0.11.2', 'xgboost==2.0.3', 'requests==2.31.0,>=2.21.0', 'psycopg2-binary==2.9.9', 'fastapi', 'alembic==1.13.1', '-r', '/home/sln/micromamba', '--json']
Run three things: • Just like that • CONDA_CHANNEL_PRIORITY=flexible • adding the --channel-priority 1 to the command line I currently do the second option (I think) and I’d be curious to see if the third one works. If so I’ll switch to that for micromamba (I think mamba already respects the env var)
h
Sure, will try it in sometime
Here's the logs for the above ones. I doubt if integers are allowed for channel priority
--channel-priority 1
d
flexible instead of 1 if that doesn’t work.
h
Looks like setting in the cmd line works, but not env variable
--channel-priority flexible
d
Awesome. That’s the issue then. Interesting it doesn’t respect it. Annoying that these things change so much between executables. I’ll fix it.
🙌 1
h
Im hoping its not just with micromamba and happening with others like conda/mamba.
d
mamba respects it (well pre 2.0) — I am adding support for 2.0 and a bunch of things have changed. The good news is that now it looks like micromamba and mamba behave the same (like micromamba)
👍 1
and for some reason the tests are failing because anaconda seems to be misbehaving.
critical libmamba Transfer finalized, status: 403 [<https://conda.anaconda.org/conda-forge/osx-arm64/libffi-3.4.2-h3422bc3_5.tar.bz2>] 151 bytes
which makes things fun to try to test 🙂
😆 1
I think I’ll wait for anaconda to get back to normal before tracking down random issues
h
Happens sometimes with micromamba aswell. It works almost immediately.
137 Views