FileNotFoundError: [Errno 2] No such file or directory: 'bowtie2-build'

Hi, I have installed metaphlan3 using pip.

When I run “metaphlan --install”, I got the following error:

Downloading MetaPhlAn database
Please note due to the size this might take a few minutes

File /opt/anaconda3/envs/metaphlan3/lib/python3.9/site-packages/metaphlan/metaphlan_databases/mpa_v30_CHOCOPhlAn_201901.tar already present!

File /opt/anaconda3/envs/metaphlan3/lib/python3.9/site-packages/metaphlan/metaphlan_databases/mpa_v30_CHOCOPhlAn_201901.md5 already present!
Traceback (most recent call last):
File “/opt/anaconda3/envs/metaphlan3/bin/metaphlan”, line 8, in
sys.exit(main())
File “/opt/anaconda3/envs/metaphlan3/lib/python3.9/site-packages/metaphlan/metaphlan.py”, line 925, in main
pars[‘index’] = check_and_install_database(pars[‘index’], pars[‘bowtie2db’], pars[‘bowtie2_build’], pars[‘nproc’], pars[‘force_download’])
File “/opt/anaconda3/envs/metaphlan3/lib/python3.9/site-packages/metaphlan/init.py”, line 301, in check_and_install_database
download_unpack_tar(index, bowtie2_db, bowtie2_build, nproc, use_zenodo)
File “/opt/anaconda3/envs/metaphlan3/lib/python3.9/site-packages/metaphlan/init.py”, line 180, in download_unpack_tar
bt2_build_output = subp.check_output([bowtie2_build, ‘–usage’], stderr=subp.STDOUT)
File “/opt/anaconda3/envs/metaphlan3/lib/python3.9/subprocess.py”, line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File “/opt/anaconda3/envs/metaphlan3/lib/python3.9/subprocess.py”, line 501, in run
with Popen(*popenargs, **kwargs) as process:
File “/opt/anaconda3/envs/metaphlan3/lib/python3.9/subprocess.py”, line 947, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File “/opt/anaconda3/envs/metaphlan3/lib/python3.9/subprocess.py”, line 1819, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'bowtie2-build’

Hi , i have the same problem, did u manged to solve it?

Hi @ryzary
Installing metaphlan using pip will not install all the dependecies necesary and you should install them manually. As an alternative, I recommend you to install it using conda