Issue Installing MetaPhlAn4 and BowTie2 Database on Macbook M1 ARM64 - Seeking Help

Hi everyone,

After several attempts, I managed to install MetaPhlAn4 on my Macbook M1 ARM64 running OSX 12.6. However, I encountered issues when trying to use Miniconda3 for arm64 following the steps outlined on the official Wiki page.

Here is the command I used to create an isolated conda environment and install MetaPhlAn:
conda create --name mpa -c conda-forge -c bioconda python=3.7 metaphlan

or

conda create --name mpa -c conda-forge -c bioconda python=3.10 metaphlan

Unfortunately, I received the following error:

Could not load conda plugin `conda-libmamba-solver`:
  
dlopen(/Users/david/miniforge3/lib/python3.10/site-packages/libmambapy/bindings.cpython-310-darwin.so, 0x0002): Library not loaded: '@rpath/libarchive.13.dylib'
Referenced from: '/Users/david/miniforge3/lib/libmamba.2.0.0.dylib'
Reason: tried: '/Users/david/miniforge3/lib/libarchive.13.dylib' (no such file), '/Users/david/miniforge3/lib/python3.10/site-packages/libmambapy/../../../libarchive.13.dylib' (no such file), '/Users/david/miniforge3/lib/python3.10/site-packages/libmambapy/../../../libarchive.13.dylib' (no such file), '/Users/david/miniforge3/bin/../lib/libarchive.13.dylib' (no such file), '/Users/david/miniforge3/bin/../lib/libarchive.13.dylib' (no such file), '/usr/local/lib/libarchive.13.dylib' (no such file), '/usr/lib/libarchive.13.dylib' (no such file)
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: - 
 Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                                                                              

UnsatisfiableError: The following specifications were found to be incompatible with each other:
  
  Output in format: Requested package -> Available versions

Package python conflicts for:
  metaphlan -> biopython -> python[version='>=2.7,<3|>=3.10,<3.11.0a0|>=3.10,<3.11.0a0|>=3.12,<3.13.0a0|>=3.12,<3.13.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.12.0rc3,<3.13.0a0|>=3.12.0rc3,<3.13.0a0|>=3.7,<4.0|>=3.6,<4.0|>=3.6',build=*_cpython]
python=3.10
metaphlan -> python[version='2.7.*|>=3|>=3.7']The following specifications were found to be incompatible with your system:
  
- feature:/osx-arm64::__osx==12.6=0
- metaphlan -> matplotlib-base -> __osx[version='>=10.9']
- python=3.10 -> ncurses[version='>=6.4,<7.0a0'] -> __osx[version='>=10.9']

Your installed version is: 12.6

Frustrated with this, I successfully installed MetaPhlAn using the pip approach:

pip install metaphlan

However, when attempting to profile a metagenome using the command:

metaphlan SRR9641941_1.fastq,SRR9641941_2.fastq --bowtie2out metagenome.bowtie2.bz2 --nproc 9 --input_type fastq -o profiled_metagenome.txt

I encountered the error:

No MetaPhlAn BowTie2 database found (--index option)!

Even though the database was seemingly installed successfully:

metaphlan --install
The database is installed

I specified the database location:

metaphlan SRR9641941_1.fastq,SRR9641941_2.fastq --bowtie2out metagenome.bowtie2.bz2 --nproc 9 --input_type fastq -o profiled_metagenome.txt --bowtie2db /Users/david/miniforge3/lib/python3.10/site-packages/metaphlan/metaphlan_databases

But received the error:

No MetaPhlAn BowTie2 database found (--index option)!
Expecting location bowtie2db

Upon checking the database directory, everything seems in order:

ls /Users/david/miniforge3/lib/python3.10/site-packages/metaphlan/metaphlan_databases

Output:

README.txt					mpa_vOct22_CHOCOPhlAnSGB_202212.pkl		mpa_vOct22_CHOCOPhlAnSGB_202212_VSG.fna
mpa_latest					mpa_vOct22_CHOCOPhlAnSGB_202212_SGB.fna		mpa_vOct22_CHOCOPhlAnSGB_202212_bt2.md5
mpa_vOct22_CHOCOPhlAnSGB_202212.fna		mpa_vOct22_CHOCOPhlAnSGB_202212_VINFO.csv	mpa_vOct22_CHOCOPhlAnSGB_202212_bt2.tar

I’m seeking assistance on resolving this issue. Any suggestions or guidance would be greatly appreciated.

Thanks in advance!

It appears that I successfully resolved the issue through the following steps:
After installed Miniconda3 for arm64

CONDA_SUBDIR=osx-arm64 conda create -n native numpy -c conda-forge 

will get you a osx-arm64 native env

To make it permanent, do,

conda activate native 
conda config --env --set subdir osx-arm64

Than, need help from Homebrew

brew update
brew install libb2
brew install tbb
brew install bowtie2

sudo conda config --set solver libmamba