mafft does not work inside my Qiime2 environment

When it comes to the PATH variable, the order of items matters. You can see below that the mafft installation external to your qiime 2 conda environment appears before the qiime 2 environment. It's important that the qiime 2 environment comes first. Otherwise, your computer will favor programs that appear earlier in the list.

PATH=/opt/local/bin/mafft:/Users/m213406/Filtlong/bin:/Users/m213406/nanotimeparse:/Users/m213406/NanoOK/bin:/opt/local/share/arb/bin:/opt/local/bin:/opt/local/sbin:/Users/m213406/opt/anaconda3/envs/qiime2-2021.2/bin:/Users/m213406/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/m213406/centrifuge/bin:/usr/local/ncbi/blast/bin:/Library/TeX/texbin:/opt/X11/bin

Usually, the PATH variable is configured in the ~/.bash_profile on mac os, but it could be conifigured elsewhere like in ~/.zshrc. The way to fix this is figure out where PATH is being set, and to remove the line that is prepending mafft to the variable. For example, if you find the following line in your ~/.bash_profile:

export PATH=/opt/local/bin/mafft:$PATH

This would prepend that specific mafft installation. In this case, you could just remove that line entirely.

Note that there are also several other items which appear at the beginning of the list, prior to the qiime2 bit. This may or may not cause problems, but is often a sign of a less than ideal approach to configuring PATH.

I hope that helps! Good luck, and let me know how you get along.

1 Like