curved-easter-84159
08/01/2023, 3:32 PM@conda decorator, in which I get a json.decoder.JSONDecodeError when I try to run the flow. Will paste the full error, as well as the Flow definition (it's a dummy flow) in the thread.
INTERIM SOLVE: downgrade conda to 22.11.1. In later versions of conda, conda info (or self._info()) no longer outputs JSON. Hat tip to @faint-rocket-4408 for pointing this out.curved-easter-84159
08/01/2023, 3:33 PM(mflow2) davidkale@ringil metaflow-tools % python test_flow.py --environment=conda run
Metaflow 2.9.11 executing TestFlow for user:davidkale
Validating your flow...
The graph looks good!
Running pylint...
Pylint not found, so extra checks are disabled.
Bootstrapping conda environment...(this could take a few minutes)
Internal error
Traceback (most recent call last):
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/site-packages/metaflow/cli.py", line 1172, in main
start(auto_envvar_prefix="METAFLOW", obj=state)
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/site-packages/metaflow/_vendor/click/core.py", line 829, in __call__
return self.main(args, kwargs)
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/site-packages/metaflow/_vendor/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/site-packages/metaflow/_vendor/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/site-packages/metaflow/_vendor/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/site-packages/metaflow/_vendor/click/core.py", line 610, in invoke
return callback(args, kwargs)
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/site-packages/metaflow/cli.py", line 691, in wrapper
return func(args, kwargs)
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/site-packages/metaflow/_vendor/click/decorators.py", line 33, in new_func
return f(get_current_context().obj, args, kwargs)
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/site-packages/metaflow/cli.py", line 828, in run
before_run(obj, tags, decospecs + obj.environment.decospecs())
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/site-packages/metaflow/cli.py", line 886, in before_run
obj.package = MetaflowPackage(
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/site-packages/metaflow/package.py", line 73, in __init__
deco.package_init(flow, step.__name__, environment)
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/site-packages/metaflow/plugins/conda/conda_step_decorator.py", line 355, in package_init
self._prepare_step_environment(step, self.local_root)
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/site-packages/metaflow/plugins/conda/conda_step_decorator.py", line 216, in _prepare_step_environment
env_id = self._resolve_step_environment(ds_root)
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/site-packages/metaflow/plugins/conda/conda_step_decorator.py", line 124, in _resolve_step_environment
CondaStepDecorator.conda = Conda()
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/site-packages/metaflow/plugins/conda/conda.py", line 43, in __init__
if LooseVersion(self._info()["conda_version"]) < LooseVersion("4.6.0"):
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/site-packages/metaflow/plugins/conda/conda.py", line 111, in _info
return json.loads(self._call_conda(["info"]))
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/davidkale/miniconda3/envs/mflow2/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)ancient-application-36103
08/01/2023, 3:33 PMcurved-easter-84159
08/01/2023, 3:33 PMfrom metaflow import FlowSpec, step, schedule, conda
from metaflow import conda_base
@conda_base(python='3.10.6')
class TestFlow(FlowSpec):
"""
A flow where Metaflow prints 'Hi'.
Run this flow to validate that Metaflow is installed correctly.
"""
# @conda(disabled=False)
@step
def start(self):
"""
This is the 'start' step. All flows must have a step named 'start' that
is the first step in the flow.
"""
print("Step (start)")
self.next(self.a)
@conda(libraries={'pandas': '1.5.1'})
@step
def a(self):
"""
A step for metaflow to introduce itself.
"""
print("Step (a)")
self.next(self.end)
# @conda(disabled=False)
@step
def end(self):
"""
This is the 'end' step. All flows must have an 'end' step, which is the
last step in the flow.
"""
print("Step (end)")
if __name__ == "__main__":
TestFlow()
I ran it with the command python test_flow.py --environment=conda runancient-application-36103
08/01/2023, 3:33 PMconda ?curved-easter-84159
08/01/2023, 3:34 PMcurved-easter-84159
08/01/2023, 3:34 PMancient-application-36103
08/01/2023, 3:36 PMcurved-easter-84159
08/01/2023, 3:37 PM--with kubernetes and got a DIFFERENT error, related to the ncurses package and file system case insensitivity. After that, I started getting this json decode error. I unfortunately didn't record that error and so far haven't been able to reproduce it.curved-easter-84159
08/01/2023, 3:38 PMfaint-rocket-4408
08/01/2023, 6:11 PMcurved-easter-84159
08/01/2023, 6:27 PMcurved-easter-84159
08/01/2023, 6:44 PM--environment=conda worked great (locally...gonna try --with kubernetes next). Savin, should I file an issue on github?ancient-application-36103
08/01/2023, 6:49 PMcurved-easter-84159
08/01/2023, 7:45 PM