Hello team, Getting an error from using Metaflow ...
# ask-metaflow
a
Hello team, Getting an error from using Metaflow bleeding edge decorator `metaflow-netflixext`:
Copy code
FileNotFoundError: [Errno 2] No such file or directory: '/.local/bin/micromamba'
I thought it will automatically install
micromamba
if
micromamba
not already installed?
Copy code
Bootstrapping Conda environment... (this could take a few minutes)
                    Resolving 1 environment ...    Internal error
                Traceback (most recent call last):
                  File "/opt/conda/lib/python3.12/site-packages/metaflow/cli.py", line 1177, in main
                    start(auto_envvar_prefix="METAFLOW", obj=state)
                  File "/opt/conda/lib/python3.12/site-packages/metaflow/tracing/__init__.py", line 27, in wrapper_func
                    return func(args, kwargs)
                           ^^^^^^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/site-packages/metaflow/_vendor/click/core.py", line 829, in __call__
                    return self.main(args, kwargs)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/site-packages/metaflow/_vendor/click/core.py", line 782, in main
                    rv = self.invoke(ctx)
                         ^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/site-packages/metaflow/_vendor/click/core.py", line 1259, in invoke
                    return _process_result(sub_ctx.command.invoke(sub_ctx))
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/site-packages/metaflow/_vendor/click/core.py", line 1259, in invoke
                    return _process_result(sub_ctx.command.invoke(sub_ctx))
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/site-packages/metaflow/_vendor/click/core.py", line 1066, in invoke
                    return ctx.invoke(self.callback, ctx.params)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/site-packages/metaflow/_vendor/click/core.py", line 610, in invoke
                    return callback(args, kwargs)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/site-packages/metaflow/_vendor/click/decorators.py", line 33, in new_func
                    return f(get_current_context().obj, args, kwargs)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/site-packages/metaflow/plugins/aws/step_functions/step_functions_cli.py", line 166, in create
                    flow = make_flow(
                           ^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/site-packages/metaflow/plugins/aws/step_functions/step_functions_cli.py", line 303, in make_flow
                    obj.package = MetaflowPackage(
                                  ^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/site-packages/metaflow/package.py", line 70, in __init__
                    environment.init_environment(echo)
                  File "/opt/conda/lib/python3.12/site-packages/metaflow_extensions/netflix_ext/plugins/conda/conda_environment.py", line 139, in init_environment
                    resolver.resolve_environments(echo)
                  File "/opt/conda/lib/python3.12/site-packages/metaflow_extensions/netflix_ext/plugins/conda/envsresolver.py", line 236, in resolve_environments
                    self._resolve_environments(echo, need_resolution)
                  File "/opt/conda/lib/python3.12/site-packages/metaflow_extensions/netflix_ext/plugins/conda/envsresolver.py", line 562, in _resolve_environments
                    env_id, resolved_env, addl_builder_envs = f.result()
                                                              ^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/concurrent/futures/_base.py", line 449, in result
                    return self.__get_result()
                           ^^^^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
                    raise self._exception
                  File "/opt/conda/lib/python3.12/concurrent/futures/thread.py", line 58, in run
                    result = self.fn(self.args, self.kwargs)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/site-packages/metaflow_extensions/netflix_ext/plugins/conda/envsresolver.py", line 688, in _resolve
                    resolved_env, builder_envs = resolver.resolve(
                                                 ^^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/site-packages/metaflow_extensions/netflix_ext/plugins/conda/resolvers/pip_resolver.py", line 105, in resolve
                    self._conda.create_builder_env(builder_env), "bin", "python"
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/site-packages/metaflow_extensions/netflix_ext/plugins/conda/conda.py", line 436, in create_builder_env
                    r = self.create_for_name(
                        ^^^^^^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/site-packages/metaflow_extensions/netflix_ext/plugins/conda/conda.py", line 422, in create_for_name
                    env_path = self._create(env, name)
                               ^^^^^^^^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/site-packages/metaflow_extensions/netflix_ext/plugins/conda/conda.py", line 2381, in _create
                    self.call_binary(
                  File "/opt/conda/lib/python3.12/site-packages/metaflow_extensions/netflix_ext/plugins/conda/conda.py", line 320, in call_binary
                    return self.call_conda(args, binary, addl_env, pretty_print_exception)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/site-packages/metaflow_extensions/netflix_ext/plugins/conda/conda.py", line 278, in call_conda
                    subprocess.check_output(
                  File "/opt/conda/lib/python3.12/subprocess.py", line 466, in check_output
                    return run(popenargs, stdout=PIPE, timeout=timeout, check=True,
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/subprocess.py", line 548, in run
                    with Popen(popenargs, kwargs) as process:
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  File "/opt/conda/lib/python3.12/subprocess.py", line 1026, in __init__
                    self._execute_child(args, executable, preexec_fn, close_fds,
                  File "/opt/conda/lib/python3.12/subprocess.py", line 1953, in _execute_child
                    raise child_exception_type(errno_num, err_msg, err_filename)
d
you can get it to install a micromamba/mamba/conda installation but by default no, it will use whatever is on the system. I does install it on the remote system though.
although you should get a different error
a
Is it compatible with python 3.12?
d
I can take a more detail look a little later
thankyou 1
it should be — I haven’t specifically tested but I don’t think there is anything that shouldn’t be.
👍 1
could you send me — for my debug thing — running whatever you are running with
METAFLOW_DEBUG_CONDA=1 …
a
That might be tricky because this is a user flow in production that's triggered via CI/CD
Hmmm...seemed to work when I ran it locally line by line
d
Ok. Gimme a few mins and I’ll look at the current traceback to see what that tells me.
thankyou 1
what do you have set as
METAFLOW_CONDA_DEPENDENCY_RESOLVER
? In general though, it will not install it unless you set CONDA_LOCAL_DIST … for example, at Netflix we have something like this:
Copy code
CONDA_LOCAL_DIST_DIRNAME = from_conf("CONDA_LOCAL_DIST_DIRNAME", "conda-local")

CONDA_LOCAL_DIST = from_conf("CONDA_LOCAL_DIST", "conda-{arch}-20231206.tgz")

CONDA_LOCAL_PATH = from_conf("CONDA_LOCAL_PATH", "/mnt/metaflow-condav2-20231206")
which means it will download a tar ball that contains a pre-installed version of conda from conda-local in S3 (well the bucket set by CONDA_S3ROOT and install it in /mnt…
the weird thing is it looks like it found something in /.local/bin/micromamba and then somehow it went away
a
I don't think that was set.
d
if on your CI/CD node, you can print env vars and also set that one I mentioned (the
METAFLOW_DEBUG_CONDA
env-var), I can probably provide more info. It is definitely the case that if your CI/CD machine has no mamba/conda/micromamba install somewhere in the path, it won’t work but the error message should have been different.
a
Thanks @dry-beach-38304 I'm going to recreate the environment in the VM. Previously only
conda
was installed. Should I switch to
micromamba
instead?
d
conda shoudl work fine. You may need to set the env var to conda (to tell it to use conda)
It should work with any of conda, mamba or micromamba
a
Getting this:
Copy code
Bootstrapping Conda environment... (this could take a few minutes)
    Incompatible environment:
    No mamba binary found
Okay I have to set
export METAFLOW_CONDA_DEPENDENCY_RESOLVER="micromamba"
d
Yes. Or you can just set it in your config (am traveling so may be off for a bit — feel feee to post but responses may be delayed)
a
All good. It's resolved now. Everything running smoothly. Thanks a bunch!
👍 1