Metaphlan4 installation issues

Hi Metaphlan 4 team,

I’m struggling to install metaphlan 4 in a clean conda environment. I’ve been following the instructions described in your manual/wiki

It’s difficult to dot he pip installation because there’s not a good list of required package versions so Im not sure what else I need to successfully build that environment. I’ve had issues with the bowtie installation as well.

I’ve taken the following steps:

  1. Configured my conda enviroment with a strict priority for bioconda
  2. Added in the conda forge channel during installation
  3. Tried switching the python versions (3.7, 3.8, 3.9)
  4. Offered a sacrifice to my swear jar
  5. Tried switching operating systems
  6. Tried bargaining with the computer
  7. Tried updating my conda environment
  8. Tried bargaining with the collaborator about whether they really need metaphlan4 and if we could instead use a different algorithm.

Thus far, I have succeeded in finding 6 ways to not install metaphlan and messed up my conda config on two computers.

Here’s my latest conda error:

Package python conflicts for:
metaphlan -> biopython -> python[version='>=2.7,<3|>=3.10,<3.11.0a0|>=3.10,<3.11.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.9,<3.10.0a0|>=3.11,<3.12.0a0|>=3.11,<3.12.0a0|>=3.7,<4.0|>=3.6,<4.0|>=3.6',build=*_cpython]
python=3.9
metaphlan -> python[version='2.7.*|>=3|>=3.7']
Note that strict channel priority may have removed packages required for satisfiability.

Thanks,
Justine

use mamba to install:

conda install mamba
conda create -n biobakery4 python=3.7
conda activate biobakery4
mamba install -c conda-forge -c bioconda metaphlan
metaphlan --install --bowtie2db /mnt/shujuku/humann3/metaphlan/SGB

by the way,mamba install -c conda-forge -c bioconda software can install almost all software in a new environment

Hi @xiaoafei,

Thanks for the recomendation! Mamba throws a biom error:

warning  libmamba Cache file "/opt/homebrew/Caskroom/miniforge/base/pkgs/cache/57e79ec4.json" was modified by another program
warning  libmamba Cache file "/opt/homebrew/Caskroom/miniforge/base/pkgs/cache/2a957770.json" was modified by another program
warning  libmamba Cache file "/opt/homebrew/Caskroom/miniforge/base/pkgs/cache/a850f475.json" was modified by another program
warning  libmamba Cache file "/opt/homebrew/Caskroom/miniforge/base/pkgs/cache/09cdf8bf.json" was modified by another program
warning  libmamba Cache file "/opt/homebrew/Caskroom/miniforge/base/pkgs/cache/9e99ffaf.json" was modified by another program
warning  libmamba Cache file "/opt/homebrew/Caskroom/miniforge/base/pkgs/cache/3e39a7aa.json" was modified by another program
warning  libmamba Cache file "/opt/homebrew/Caskroom/miniforge/base/pkgs/cache/8bd55712.json" was modified by another program
warning  libmamba Cache file "/opt/homebrew/Caskroom/miniforge/base/pkgs/cache/4ea078d6.json" was modified by another program
bioconda/osx-arm64                                 129.0 B @ 678.0 B/s  0.2s
pkgs/main/osx-arm64                                  1.6MB @   2.7MB/s  0.6s
pkgs/r/osx-arm64                                   118.0 B @ 184.0 B/s  0.1s
pkgs/r/noarch                                        1.3MB @   2.0MB/s  0.5s
bioconda/noarch                                      4.2MB @   4.1MB/s  1.1s
pkgs/main/noarch                                   823.2kB @ 647.0kB/s  0.6s
conda-forge/osx-arm64                                6.2MB @   4.2MB/s  1.7s
conda-forge/noarch                                  12.3MB @   4.1MB/s  3.3s
Could not solve for environment specs
The following packages are incompatible
├─ metaphlan   is uninstallable because it requires
│  └─ biom-format  , which does not exist (perhaps a missing channel);
└─ python 3.7**  does not exist (perhaps a typo or a missing channel).

So I’m wondering if I should be adding the biocore channel as well. Except that a new version of biom was released last week, which might be part of the issue.

Thanks,
Justine

are you sure you install in a new environment? if not , you can remove the old environment and create a new one by conda create -n biobakery4 python=3.7 . and then, try

conda activate biobakery4
mamba install -c conda-forge -c bioconda -c defaults metaphlan
1 Like

Hi @xiaoafei,

I’m trying to build an entirely new isolated enviroment, not install it into a pre-configured enviroment.

mamba create --name mpa -c bioconda -c conda-forge python=3.7 metaphla

As I said earlier in my post,t here’s not a clear list of dependency versions.

Best,
Justine

try create a new python3.7 environment by conda, and install by mamba just like my former reply

Thanks @xiaoafei,

I get a mambda error, suggesting that 3.7 is not a version option for python.

The following package could not be installed
└─ python 3.7**  does not exist (perhaps a typo or a missing channel).

Best,
Justine

you can try to edit your .condarc file in root, use your country’s mirror instead https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud;
and then, enter my code step by step.
the detail is unloaded example.txt file
example.txt (35.9 KB)

Hi @xiaoafei,

It looks like this requires me to further modify my condarc file, but doesn’t actually address the issue I raised about the biom-format issue. However, regardless of how I configure my national branches, there isn’t a python 3.7 release available for my system. It’s not a geography issue; it’s a version issue.

Best,
Justine

Hi Justine, I’ve had very similar errors to you. The suggestions above didn’t work for me either. I went through your list too, but my number 9 was “delete and reinstall miniconda”. Now conda install bioconda::phylophlan just works again. Good Luck!