Humann3 - Upgrading metaphlan v3.0 to v4.0.6 error

Update: removing biobakery from conda channels resolved the issue of requests.exceptions.HTTPError: 404 Client Error: Not Found for url:

Performed update of metaphlan with mamba.


I installed humann3 using conda (following instruction here humann3 – The Huttenhower Lab).

While running humann, encountered error (unable to download from Dropbox). One suggested solution was to upgrade metaphlan v3.0 to 4.0.6 (Announcing HUMAnN 3.7). Running this command resulted in error (see below). I would appreciate suggestions to resolve this issue. Thanks.

(biobakery3) gurjit@PC21:~$ conda install -c bioconda metaphlan=4.0.6
Collecting package metadata (current_repodata.json): failed

>>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

Traceback (most recent call last):
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/gateways/repodata/__init__.py", line 187, in conda_http_errors
    yield
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/gateways/repodata/__init__.py", line 153, in repodata
    response.raise_for_status()
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://conda.anaconda.org/biobakery/linux-64/current_repodata.json

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/simplejson/__init__.py", line 514, in loads
    return _default_decoder.decode(s)
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/simplejson/decoder.py", line 386, in decode
    obj, end = self.raw_decode(s)
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/simplejson/decoder.py", line 416, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/exception_handler.py", line 16, in __call__
    return func(*args, **kwargs)
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/cli/main.py", line 84, in main_subshell
    exit_code = do_call(args, p)
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/cli/conda_argparse.py", line 126, in do_call
    return getattr(module, func_name)(args, parser)
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/notices/core.py", line 123, in wrapper
    return func(*args, **kwargs)
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/cli/main_install.py", line 22, in execute
    install(args, parser, "install")
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/cli/install.py", line 309, in install
    unlink_link_transaction = solver.solve_for_transaction(
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/core/solve.py", line 153, in solve_for_transaction
    unlink_precs, link_precs = self.solve_for_diff(
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/core/solve.py", line 214, in solve_for_diff
    final_precs = self.solve_final_state(
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/core/solve.py", line 357, in solve_final_state
    ssc = self._collect_all_metadata(ssc)
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/common/io.py", line 83, in decorated
    return f(*args, **kwds)
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/core/solve.py", line 571, in _collect_all_metadata
    index, r = self._prepare(prepared_specs)
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/core/solve.py", line 1285, in _prepare
    reduced_index = get_reduced_index(
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/core/index.py", line 286, in get_reduced_index
    new_records = SubdirData.query_all(
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/core/subdir_data.py", line 157, in query_all
    result = tuple(
  File "/home/gurjit/anaconda3/lib/python3.9/concurrent/futures/_base.py", line 609, in result_iterator
    yield fs.pop().result()
  File "/home/gurjit/anaconda3/lib/python3.9/concurrent/futures/_base.py", line 446, in result
    return self.__get_result()
  File "/home/gurjit/anaconda3/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
    raise self._exception
  File "/home/gurjit/anaconda3/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/core/subdir_data.py", line 142, in subdir_query
    return tuple(
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/core/subdir_data.py", line 164, in query
    self.load()
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/core/subdir_data.py", line 264, in load
    _internal_state = self._load()
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/core/subdir_data.py", line 321, in _load
    repodata, state = fetcher.fetch_latest_parsed()
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/gateways/repodata/__init__.py", line 757, in fetch_latest_parsed
    parsed, state = self.fetch_latest()
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/gateways/repodata/__init__.py", line 879, in fetch_latest
    raw_repodata = repo.repodata(cache.state)  # type: ignore
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/gateways/repodata/__init__.py", line 153, in repodata
    response.raise_for_status()
  File "/home/gurjit/anaconda3/lib/python3.9/contextlib.py", line 137, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/gateways/repodata/__init__.py", line 234, in conda_http_errors
    raise RepodataIsEmpty(
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/conda/exceptions.py", line 527, in __init__
    body = response.json()
  File "/home/gurjit/anaconda3/lib/python3.9/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

$ /home/gurjit/anaconda3/bin/conda install -c bioconda metaphlan=4.0.6

environment variables:
CIO_TEST=
CONDA_DEFAULT_ENV=biobakery3
CONDA_EXE=/home/gurjit/anaconda3/bin/conda
CONDA_PREFIX=/home/gurjit/anaconda3/envs/biobakery3
CONDA_PREFIX_1=/home/gurjit/anaconda3
CONDA_PROMPT_MODIFIER=(biobakery3)
CONDA_PYTHON_EXE=/home/gurjit/anaconda3/bin/python
CONDA_ROOT=/home/gurjit/anaconda3
CONDA_SHLVL=2
CURL_CA_BUNDLE=
LD_PRELOAD=
PATH=/home/gurjit/anaconda3/envs/biobakery3/bin:/home/gurjit/anaconda3/cond
abin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr
/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/WINDOWS/system32:/mnt/
c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/Windows
PowerShell/v1.0:/mnt/c/WINDOWS/System32/OpenSSH:/mnt/c/Program
Files/Calibre2:/mnt/c/Program Files (x86)/Common
Files/Acronis/SnapAPI:/mnt/c/Program Files/dotnet:/Docker/host/bin:/mn
t/c/Users/PC21/AppData/Local/Microsoft/WindowsApps:/snap/bin
REQUESTS_CA_BUNDLE=
SSL_CERT_FILE=

 active environment : biobakery3
active env location : /home/gurjit/anaconda3/envs/biobakery3
        shell level : 2
   user config file : /home/gurjit/.condarc

populated config files : /home/gurjit/.condarc
conda version : 23.5.0
conda-build version : 3.21.5
python version : 3.9.16.final.0
virtual packages : __archspec=1=x86_64
__cuda=11.4=0
__glibc=2.31=0
__linux=5.15.90.1=0
__unix=0=0
base environment : /home/gurjit/anaconda3 (writable)
conda av data dir : /home/gurjit/anaconda3/etc/conda
conda av metadata url : None
channel URLs : bioconda/linux-64
bioconda/noarch
Linux 64 :: Anaconda.org
Noarch :: Anaconda.org
conda-forge/linux-64
conda-forge/noarch
main/linux-64
main/noarch
r/linux-64
r/noarch
package cache : /home/gurjit/anaconda3/pkgs
/home/gurjit/.conda/pkgs
envs directories : /home/gurjit/anaconda3/envs
/home/gurjit/.conda/envs
platform : linux-64
user-agent : conda/23.5.0 requests/2.31.0 CPython/3.9.16 Linux/5.15.90.1-microsoft-standard-WSL2 ubuntu/20.04.6 glibc/2.31
UID:GID : 1000:1000
netrc file : None
offline mode : False

An unexpected error has occurred. Conda has prepared the above report.

If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers? [y/N]: y
Upload successful.

Thank you for helping to improve conda.
Opt-in to always sending reports (and not see this message again)
by running

$ conda config --set report_errors true

Looking at your update, was this entire problem solved by changing the conda channels?

Yes. I was able update metaphlan and then run humann3 without any issues.

Confirmed, thanks for clarifying!

Hi,
I am also facing this problem. Could you please explain how did u remove biobakery from conda channel

To remove biobakery channel

conda config --remove channels ‘biobakery’

to confirm that biobakery channel has been removed

conda config --show channels

1 Like

Thanks for this suggestion!