Closed remkade closed 1 year ago
We could move all downloads back into Python, now that it is multithreaded.
@jaimergp Have we fixed this in the recent commits in conda-libmamba-solver?
Nop, this is part of the vendored mamba_utils
module, which tries to stays as close as possible to upstream. We can patch it and send it to mamba though.
That said, we could try @dholth's suggestion. We are already doing it for S3/FTP channels. Maybe with an option at first?
We will need to move the repodata.json downloads back into Python for incremental repodata. The merged parallel package downloads feature should already provide great package download speed.
Ok, I can start working on this but I'd like to see the plugin work finished first so there's no more rebase issues.
This will probably fixed by #65
(I've moved this issue from the conda repo here)
Could my problem be related or should I open another ticket?
I get a JSON serialization error when libmamba fails with with the --json
filag.
I'm fairly certain that I was not having this problem 2 - 3 months ago on earlier versions of conda and libmamba.
❯ CONDA_SOLVER=libmamba conda create -n t -c conda-forge conda-token --json --override-channels
Traceback (most recent call last):
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1124, in __call__
return func(*args, **kwargs)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/cli/main.py", line 69, in main_subshell
exit_code = do_call(args, p)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/cli/conda_argparse.py", line 91, in do_call
return getattr(module, func_name)(args, parser)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/notices/core.py", line 109, in wrapper
return func(*args, **kwargs)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/cli/main_create.py", line 41, in execute
install(args, parser, 'create')
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/cli/install.py", line 280, in install
raise e
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/cli/install.py", line 264, in install
unlink_link_transaction = solver.solve_for_transaction(
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/core/solve.py", line 132, in solve_for_transaction
unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier,
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/core/solve.py", line 175, in solve_for_diff
final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned,
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda_libmamba_solver/solver.py", line 188, in solve_final_state
out_state = self._solving_loop(in_state, out_state, index)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda_libmamba_solver/solver.py", line 251, in _solving_loop
solved = self._solve_attempt(in_state, out_state, index)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda_libmamba_solver/solver.py", line 325, in _solve_attempt
new_conflicts = self._problems_to_specs(problems, old_conflicts)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda_libmamba_solver/solver.py", line 571, in _problems_to_specs
self._raise_for_problems(problems)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda_libmamba_solver/solver.py", line 597, in _raise_for_problems
raise exc
conda.exceptions.PackagesNotFoundError: The following packages are not available from current channels:
- conda-token
Current channels:
- https://conda.anaconda.org/conda-forge
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/adefusco/Applications/miniconda3/bin/conda", line 13, in <module>
sys.exit(main())
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/cli/main.py", line 112, in main
return conda_exception_handler(main, *args, **kwargs)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1424, in conda_exception_handler
return_value = exception_handler(func, *args, **kwargs)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1127, in __call__
return self.handle_exception(exc_val, exc_tb)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1156, in handle_exception
return self.handle_application_exception(exc_val, exc_tb)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1170, in handle_application_exception
self._print_conda_exception(exc_val, exc_tb)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1174, in _print_conda_exception
print_conda_exception(exc_val, exc_tb)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1097, in print_conda_exception
exc_json = json.dumps(exc_val.dump_map(), indent=2, sort_keys=True, cls=EntityEncoder)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/json/__init__.py", line 234, in dumps
return cls(
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/json/encoder.py", line 201, in encode
chunks = list(chunks)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/json/encoder.py", line 431, in _iterencode
yield from _iterencode_dict(o, _current_indent_level)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/json/encoder.py", line 405, in _iterencode_dict
yield from chunks
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/json/encoder.py", line 438, in _iterencode
o = _default(o)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/auxlib/entity.py", line 962, in default
return JSONEncoder.default(self, obj)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/site-packages/conda/__init__.py", line 145, in _default
return getattr(obj.__class__, "to_json", _default.default)(obj)
File "/Users/adefusco/Applications/miniconda3/lib/python3.9/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type IndexedSet is not JSON serializable
With the classic solver I get clean json
❯ CONDA_SOLVER=classic conda create -n t -c conda-forge conda-token --json --override-channels
{
"caused_by": "None",
"channel_urls": [
"https://conda.anaconda.org/conda-forge/osx-arm64",
"https://conda.anaconda.org/conda-forge/noarch"
],
"channels_formatted": " - https://conda.anaconda.org/conda-forge/osx-arm64\n - https://conda.anaconda.org/conda-forge/noarch",
"error": "PackagesNotFoundError: The following packages are not available from current channels:\n\n - conda-token\n\nCurrent channels:\n\n - https://conda.anaconda.org/conda-forge/osx-arm64\n - https://conda.anaconda.org/conda-forge/noarch\n\nTo search for alternate channels that may provide the conda package you're\nlooking for, navigate to\n\n https://anaconda.org\n\nand use the search bar at the top of the page.\n",
"exception_name": "PackagesNotFoundError",
"exception_type": "<class 'conda.exceptions.PackagesNotFoundError'>",
"message": "The following packages are not available from current channels:\n\n - conda-token\n\nCurrent channels:\n\n - https://conda.anaconda.org/conda-forge/osx-arm64\n - https://conda.anaconda.org/conda-forge/noarch\n\nTo search for alternate channels that may provide the conda package you're\nlooking for, navigate to\n\n https://anaconda.org\n\nand use the search bar at the top of the page.\n",
"packages": [
"conda-token"
],
"packages_formatted": " - conda-token"
}
Different problem, but thanks for the report! See #140 @AlbertDeFusco
Checklist
What happened?
When you try to use a non-existent channel in conda with the default solver you get a helpful HTTP 404 error.
But when you use libmamba:
Conda Details
```Shell active environment : base active env location : /Users/kleaders/anaconda3 shell level : 1 user config file : /Users/kleaders/.condarc populated config files : /Users/kleaders/.condarc conda version : 22.9.0 conda-build version : 3.21.9 python version : 3.8.13.final.0 virtual packages : __osx=10.16=0 __unix=0=0 __archspec=1=x86_64 base environment : /Users/kleaders/anaconda3 (writable) conda av data dir : /Users/kleaders/anaconda3/etc/conda conda av metadata url : None channel URLs : https://repo.anaconda.com/pkgs/main/osx-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/osx-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /Users/kleaders/anaconda3/pkgs /Users/kleaders/.conda/pkgs envs directories : /Users/kleaders/anaconda3/envs /Users/kleaders/.conda/envs platform : osx-64 user-agent : conda/22.9.0 requests/2.27.1 CPython/3.8.13 Darwin/21.5.0 OSX/10.16 UID:GID : 502:20 netrc file : None offline mode : False ```conda info
```Shell ==> /Users/kleaders/.condarc <== channels: - defaults ```conda config
```Shell # # Name Version Build Channel _anaconda_depends 2021.11 py38_0 defaults _ipyw_jlab_nb_ext_conf 0.1.0 py38_0 defaults abs 0.0.0 dev_0conda list
Error Report
``` Traceback (most recent call last): File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda_libmamba_solver/solver.py", line 224, in solve_final_state index = LibMambaIndexHelper( File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda_libmamba_solver/solver.py", line 87, in __init__ self._index = load_channels( File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda_libmamba_solver/mamba_utils.py", line 117, in load_channels index = get_index( File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda_libmamba_solver/mamba_utils.py", line 98, in get_index is_downloaded = dlist.download(api.MAMBA_DOWNLOAD_FAILFAST) RuntimeError: Multi-download failed. # >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<< Traceback (most recent call last): File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda_libmamba_solver/solver.py", line 224, in solve_final_state index = LibMambaIndexHelper( File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda_libmamba_solver/solver.py", line 87, in __init__ self._index = load_channels( File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda_libmamba_solver/mamba_utils.py", line 117, in load_channels index = get_index( File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda_libmamba_solver/mamba_utils.py", line 98, in get_index is_downloaded = dlist.download(api.MAMBA_DOWNLOAD_FAILFAST) RuntimeError: Multi-download failed. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda/exceptions.py", line 1129, in __call__ return func(*args, **kwargs) File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda/cli/main.py", line 86, in main_subshell exit_code = do_call(args, p) File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda/cli/conda_argparse.py", line 93, in do_call return getattr(module, func_name)(args, parser) File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda/notices/core.py", line 72, in wrapper return_value = func(*args, **kwargs) File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda/cli/main_create.py", line 43, in execute install(args, parser, 'create') File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda/cli/install.py", line 261, in install unlink_link_transaction = solver.solve_for_transaction( File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 156, in solve_for_transaction unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier, File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 199, in solve_for_diff final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned, File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda_libmamba_solver/solver.py", line 224, in solve_final_state index = LibMambaIndexHelper( File "/Users/kleaders/anaconda3/lib/python3.8/site-packages/conda_libmamba_solver/utils.py", line 86, in __exit__ raise exc_type(exc_value) RuntimeError: Multi-download failed. `$ /Users/kleaders/anaconda3/bin/conda create --dry-run -n intel-test -c main/nonexistent -c main --experimental-solver=libmamba tensorflow` environment variables: CIO_TEST=