# BowTie2 in the system path?

**URL:** <https://forum.biobakery.org/t/bowtie2-in-the-system-path/941>\
**Category:** MetaPhlAn\
**Created:** [August 31, 2020, 2:32am UTC](https://forum.biobakery.org/t/bowtie2-in-the-system-path/941 "2020-08-31T02:32:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jane](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@jane](https://forum.biobakery.org/u/jane)\
**Post date:** [August 31, 2020, 2:32am UTC](https://forum.biobakery.org/t/bowtie2-in-the-system-path/941/1 "2020-08-31T02:32:05Z")

</div>

Hi,

I’m trying to run strainphlan ultimately but first having trouble with metaphlan.  
I installed metaphlan through anaconda, and the version installed is: _metaphlan 3.0 (pyh5ca1d4c\_2)._

First command I ran:  
**metaphlan 6A\_R1\_001.fastq.gz,6A\_R2\_001.fastq.gz -s metagenome6A.sam.bz2 --bowtie2out metagenome6A.bowtie2.bz2 --nproc 5 --input\_type fastq -o profiled\_metagenome6A.txt**

This created 6 bt.2 files in the metaphlan database directory. But then gave this error:  
_Fatal error running BowTie2. Is BowTie2 in the system path?_

Bowtie is installed at: _/opt/anaconda3/bin/bowtie2_

I also tried this:  
**metaphlan 6A\_R1\_001.fastq.gz,6A\_R2\_001.fastq.gz -s metagenome6A.sam.bz2 --bowtie2db /opt/anaconda3/lib/python3.7/site-packages/metaphlan/metaphlan\_databases -x mpa\_v30\_CHOCOPhlAn\_201901 --bowtie2out metagenome6A.bowtie2.bz2 --nproc 5 --input\_type fastq -o profiled\_metagenome6A.txt**  
which failed with the same error.

What could be the problem? Thank you already for your time on this!

---

<div class="post-metadata">

**Author:** ![fbeghini](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/fbeghini/32/81_2.png) [@fbeghini](https://forum.biobakery.org/u/fbeghini)\
**Post date:** [August 31, 2020, 7:42am UTC](https://forum.biobakery.org/t/bowtie2-in-the-system-path/941/2 "2020-08-31T07:42:08Z")

</div>

> [@jane](#):
>
> _Fatal error running BowTie2. Is BowTie2 in the system path?_

MetaPhlAn is unable to find the bowtie2 executable, can you check if `/opt/anaconda3/` is present in `$PATH`?

Otherwise, you can specify the executable’s location with the `--bowtie2_exe` parameter (`--bowtie2_exe /opt/anaconda3/bin/bowtie2`.

---

<div class="post-metadata">

**Author:** ![jane](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@jane](https://forum.biobakery.org/u/jane)\
**Post date:** [August 31, 2020, 9:58am UTC](https://forum.biobakery.org/t/bowtie2-in-the-system-path/941/3 "2020-08-31T09:58:40Z")

</div>

Thank you for the quick response but I’m still having the same issue.  
I tried both of your suggestions but none worked. Here’s the error:

_Possible unintended interpolation of @mac in string at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config\_heavy.pl line 250._  
_Possible unintended interpolation of @mac in string at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config\_heavy.pl line 1177._  
_Global symbol “@mac” requires explicit package name (did you forget to declare “my @mac”?) at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config\_heavy.pl line 250._  
_Global symbol “@mac” requires explicit package name (did you forget to declare “my @mac”?) at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config\_heavy.pl line 1177._  
_Compilation failed in require at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config.pm line 105._  
_OSError: “Command ‘[‘bowtie2’, ‘-h’]’ returned non-zero exit status 255.”_  
_Fatal error running BowTie2. Is BowTie2 in the system path?_

I can run bowtie2 by just calling it, so it must be in the system path…

---

<div class="post-metadata">

**Author:** ![fbeghini](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/fbeghini/32/81_2.png) [@fbeghini](https://forum.biobakery.org/u/fbeghini)\
**Post date:** [August 31, 2020, 10:56am UTC](https://forum.biobakery.org/t/bowtie2-in-the-system-path/941/4 "2020-08-31T10:56:34Z")

</div>

What does it print if you run `bowtie2 -h`? Have you installed MetaPhlAn in an environment different than the “base” one?

---

<div class="post-metadata">

**Author:** ![jane](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@jane](https://forum.biobakery.org/u/jane)\
**Post date:** [August 31, 2020, 11:03am UTC](https://forum.biobakery.org/t/bowtie2-in-the-system-path/941/5 "2020-08-31T11:03:50Z")

</div>

Actually, that’s the problem. I cannot run it (_bowtie2 -h_). If I do:

_Possible unintended interpolation of @mac in string at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config\_heavy.pl line 250._  
_Possible unintended interpolation of @mac in string at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config\_heavy.pl line 1177._  
_Global symbol “@mac” requires explicit package name (did you forget to declare “my @mac”?) at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config\_heavy.pl line 250._  
_Global symbol “@mac” requires explicit package name (did you forget to declare “my @mac”?) at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config\_heavy.pl line 1177._  
_Compilation failed in require at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config.pm line 105._

I’m not very sure but i don’t think i installed metaphlan in a different environment because when i run _conda list_, both are there.  
**bowtie2 2.4.1 py37h5e6fd57\_3 bioconda**  
**metaphlan 3.0 pyh5ca1d4c\_2 bioconda**

And this is how I installed metaphlan:

**conda config --add channels defaults**  
**conda config --add channels bioconda**  
**conda config --add channels conda-forge**  
**conda install -c bioconda python=3.7 metaphlan=3.0=pyh5ca1d4c\_2 --no-channel-priority**

---

<div class="post-metadata">

**Author:** ![fbeghini](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/fbeghini/32/81_2.png) [@fbeghini](https://forum.biobakery.org/u/fbeghini)\
**Post date:** [August 31, 2020, 11:40am UTC](https://forum.biobakery.org/t/bowtie2-in-the-system-path/941/6 "2020-08-31T11:40:57Z")

</div>

You should try to install MetaPhlAn in a new clean environment to avoid incompatibilities. In a new environment with just Python 3.7 (`conda create -n metaphlan-3.0 python=3.7`), install the latest MetaPhlAn build (`conda activate metaphlan-3.0 && conda install metaphlan=3.0.3`). This will install all the dependencies and the latest version, the build you forced the installation is quite old and affected by several bugs.

---

<div class="post-metadata">

**Author:** ![jane](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@jane](https://forum.biobakery.org/u/jane)\
**Post date:** [August 31, 2020, 12:35pm UTC](https://forum.biobakery.org/t/bowtie2-in-the-system-path/941/7 "2020-08-31T12:35:45Z")

</div>

> [@fbeghini](#):
>
> onment to avoid incompatibilities. In a new environment with just Python 3.7 ( `conda create -n `

Yes!! It solved the problem! Thank you so much 🙂
