Open r-molins-mrp opened 10 months ago
Thanks for the report! I have been unable to reproduce this issue locally.
I suspect it could have to do with the Conda executable. Unfortunately the stack trace doesn't provide me with enough info to understand what's going on. (We should improve this.)
Could you please edit /home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/site-packages/conda_lock/conda_solver.py
and change line 390 to
print_proc(proc)
This should let us figure out what's going on.
Sure; I have modified that line so now my conda_solver.py
looks like:
So now if I run conda-lock -f environment.yml
it returns (I don't see much difference)
Locking dependencies for ['linux-64', 'osx-64', 'osx-arm64', 'win-64']... INFO:conda_lock.conda_solver:linux-64 using specs ['python <3.12', 'jupyter', 'notebook', 'pandas', 'matplotlib', 'smopy', 'bokeh', 'conda-lock', 'tectonic', 'pytables', 'windrose', 'scipy', 'seaborn'] Command: ['/home/rmolins/mambaforge/condabin/mamba', 'create', '--prefix', '/tmp/tmpy2_a0c8g/prefix', '--dry-run', '--json', '--override-channels', '--channel', 'conda-forge', '--channel', 'defaults', '--channel', 'file:///tmp/tmpepak700k', 'python <3.12', 'jupyter', 'notebook', 'pandas', 'matplotlib', 'smopy', 'bokeh', 'conda-lock', 'tectonic', 'pytables', 'windrose', 'scipy', 'seaborn'] STDOUT: Currently, only install, create, list, search, run, info, clean, remove, update, repoquery, activate and deactivate are supported through mamba.
Traceback (most recent call last): File "/home/rmolins/mambaforge/envs/operational-analysis/bin/conda-lock", line 10, in
sys.exit(main()) ^^^^^^ File "/home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/site-packages/conda_lock/conda_lock.py", line 1388, in lock lock_func( File "/home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/site-packages/conda_lock/conda_lock.py", line 1096, in run_lock make_lock_files( File "/home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/site-packages/conda_lock/conda_lock.py", line 393, in make_lock_files fresh_lock_content = create_lockfile_from_spec( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/site-packages/conda_lock/conda_lock.py", line 824, in create_lockfile_from_spec deps = _solve_for_arch( ^^^^^^^^^^^^^^^^ File "/home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/site-packages/conda_lock/conda_lock.py", line 743, in _solve_for_arch conda_deps = solve_conda( ^^^^^^^^^^^^ File "/home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/site-packages/conda_lock/conda_solver.py", line 157, in solve_conda dry_run_install = solve_specs_for_arch( ^^^^^^^^^^^^^^^^^^^^^ File "/home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/site-packages/conda_lock/conda_solver.py", line 392, in solve_specs_for_arch dryrun_install: DryRunInstall = json.loads(extract_json_object(proc.stdout)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/json/init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/rmolins/mambaforge/envs/operational-analysis/lib/python3.11/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)
Let me know if you need anything else.
That helps a lot!
Here's what we gained:
Command: ['/home/rmolins/mambaforge/condabin/mamba', 'create', '--prefix', '/tmp/tmpy2_a0c8g/prefix', '--dry-run', '--json', '--override-channels', '--channel', 'conda-forge', '--channel', 'defaults', '--channel', 'file:///tmp/tmpepak700k', 'python <3.12', 'jupyter', 'notebook', 'pandas', 'matplotlib', 'smopy', 'bokeh', 'conda-lock', 'tectonic', 'pytables', 'windrose', 'scipy', 'seaborn']
STDOUT:
Currently, only install, create, list, search, run, info, clean, remove, update, repoquery, activate and deactivate are supported through mamba.
Something seems screwed up with Mamba. Could you please try running:
/home/rmolins/mambaforge/condabin/mamba --version
I hope it's an old Mamba version, and upgrading Mamba will fix the issue.
Note to self: we should check the version of Mamba before using it, and encourage the user to upgrade in case they're using something ancient.
Ok great; /home/rmolins/mambaforge/condabin/mamba --version
returns
mamba 1.5.3 conda 23.11.0
I'm far from being an expert with Python environments so I wouldn't be surprised if mamba
is messed up in my set-up. I'm investigating.
So I have updated mamba via conda using conda update mamba
I did note this is apparently not recommended in mamba doc, but at least now I have mamba 1.5.6.
And now doing conda-lock -f environment.yml
works and generate the lock file, so problem solved!
It could have been nice to have some checks on the version of mamba indeed, but thanks a lot for your help @maresb!
Thanks for taking the time to make the report @r-molins-mrp. Also I'm glad I could fix your problem.
I'll rework this issue into a todo...
Previous title: conda-lock -f environment.yml returns JSONDecodeError and fails
Checklist
What happened?
When trying to run
conda-lock -f environment.yml
with the following
environment.yml
file:it returns:
And fails - the lock file is not created.
Conda Info
Conda Config
Conda list
Additional Context
No response