QIIME2 not working on MacOs Catalina

Hello.

I am a QIIME2 user, up to now I used it on Linux Virtual Box and also on MacOs Mojave without any problem. I am now working on a computer with MacOs Catalina 10.15.7. I apparently installed Minconda and QIIME2 (2021.2). Installation seemed to be succesfull: with “conda activate qiime2-2021.2”, conda environment is apparently activated and I apparently enter QIIME2. When listing the directories, both conda and QIIME2 appear as present and installed. Nevertheless, no script seems to run (not even the simplest “qiime --help”). I always get the error “zsh: command not found: qiime”.
Can anybody help? Thank you very much!

1 Like

Hi @claudia.vannini,

Welcome to the Forum! I’m not part of the official QIIME 2 team, but I had a similar issue when I updated my MacOS to Catalina. Basically, the problem is, starting with Catalina, Apple changed the default shell from bash to zsh, and that’s what’s causing the problem with Anaconda. This can be easily fixed by configuring your conda profile to zsh, as described in this StackOverflow post:

If you are on macOS Catalina , the new default shell is zsh. You will instead need to run source <path to conda>/bin/activate followed by conda init zsh .

I hope this fixes your problem, good luck!

3 Likes

Hello @sbslee ,

thank you very much! I already tried that. Here’s my home user directories:

(base) [email protected] ~ % ls
–i-data CytoscapeConfiguration
–i-table Desktop
–i-taxonomy Documents
–input-path Downloads
–o-collapsed-table Library
–o-visualization Movies
–output-path Music
–p-level Pictures
–to-tsv Public
-i miniconda3
-o qiime2-2021.2-py36-osx-conda.yml
Applications

I tried following the recommendation, but I got “no action taken”:

(base) [email protected] ~ % source miniconda3/bin/activate
(base) [email protected] ~ % conda init zsh
no change /Users/claudia/miniconda3/condabin/conda
no change /Users/claudia/miniconda3/bin/conda
no change /Users/claudia/miniconda3/bin/conda-env
no change /Users/claudia/miniconda3/bin/activate
no change /Users/claudia/miniconda3/bin/deactivate
no change /Users/claudia/miniconda3/etc/profile.d/conda.sh
no change /Users/claudia/miniconda3/etc/fish/conf.d/conda.fish
no change /Users/claudia/miniconda3/shell/condabin/Conda.psm1
no change /Users/claudia/miniconda3/shell/condabin/conda-hook.ps1
no change /Users/claudia/miniconda3/lib/python3.8/site-packages/xontrib/conda.xsh
no change /Users/claudia/miniconda3/etc/profile.d/conda.csh
no change /Users/claudia/.zshrc
No action taken.

QIIME2 scripts do not work yet. Any suggestion?
Thank you!

1 Like

Have you launched a new terminal session? After running conda init that is required, to make sure that conda is loaded into your shell.

After launching the new shell, you can run conda activate qiime2-2021.2, followed by qiime info to verify the installation is activated and working.

Hello @thermokarst ,

thank you for the help! I ran

Last login: Wed Mar 17 09:44:16 on ttys002
(base) [email protected] ~ % source miniconda3/bin/activate
(base) [email protected] ~ % conda init zsh
no change /Users/claudia/miniconda3/condabin/conda
no change /Users/claudia/miniconda3/bin/conda
no change /Users/claudia/miniconda3/bin/conda-env
no change /Users/claudia/miniconda3/bin/activate
no change /Users/claudia/miniconda3/bin/deactivate
no change /Users/claudia/miniconda3/etc/profile.d/conda.sh
no change /Users/claudia/miniconda3/etc/fish/conf.d/conda.fish
no change /Users/claudia/miniconda3/shell/condabin/Conda.psm1
no change /Users/claudia/miniconda3/shell/condabin/conda-hook.ps1
no change /Users/claudia/miniconda3/lib/python3.8/site-packages/xontrib/conda.xsh
no change /Users/claudia/miniconda3/etc/profile.d/conda.csh
no change /Users/claudia/.zshrc
No action taken.
(base) [email protected] ~ %

Then I opened a new shell and ran

Last login: Wed Mar 17 09:45:00 on ttys000
(base) [email protected] ~ % conda activate qiime2-2021.2
(qiime2-2021.2) [email protected] ~ % qiime info
zsh: command not found: qiime
(qiime2-2021.2) [email protected] ~ %

So, it seems it’s still not working. It looks like we did not manage to get out from zsh. Did I miss anything?
Thank you very much!

Just one info more: I installed miniconda and QIIME2 with the computer already working in Catalina. Perhaps I should change the shell from zsh to bash and then try to re-install conda and qiime?

It sounds like there might be some crossed wires in this computer’s current conda configuration - please run the following commands (with no conda environments activated):

env

and

conda env list

and

conda list -n qiime2-2021.2

Please copy and paste the complete results from each command here.
Please paste into a “command block”:

```
your pasted code or output here
```

This will ensure the output is formatted correctly.

Thanks!

PS - zsh vs bash shouldn’t really matter here - let’s sort it out with the current shell you have set up!

Hi @thermokarst,

thank you, I followed your suggestion. Here’s the three commands run.

(base) [email protected] ~ % env
TMPDIR=/var/folders/1h/0ryk9d952nl16m3bcqsfyv3h0000gn/T/
XPC_FLAGS=0x0
TERM_PROGRAM_VERSION=433
LANG=it_IT.UTF-8
TERM_PROGRAM=Apple_Terminal
XPC_SERVICE_NAME=0
TERM_SESSION_ID=32806CE5-9646-4184-A42A-8F5D83BCC70B
TERM=xterm-256color
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.obezSkrJmT/Listeners
SHELL=/bin/zsh
HOME=/Users/claudia
LOGNAME=claudia
USER=claudia
PATH=/Users/claudia/miniconda3/bin:/Users/claudia/miniconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
SHLVL=1
PWD=/Users/claudia
OLDPWD=/Users/claudia
CONDA_EXE=/Users/claudia/miniconda3/bin/conda
_CE_M=
_CE_CONDA=
CONDA_PYTHON_EXE=/Users/claudia/miniconda3/bin/python
CONDA_SHLVL=1
CONDA_PREFIX=/Users/claudia/miniconda3
CONDA_DEFAULT_ENV=base
CONDA_PROMPT_MODIFIER=(base) 
_=/usr/bin/env
(base) [email protected] ~ % conda env list
# conda environments:
#
base                  *  /Users/claudia/miniconda3
qiime2-2021.2            /Users/claudia/miniconda3/envs/qiime2-2021.2

(base) [email protected] ~ % conda list -n qiime2-2021.2
# packages in environment at /Users/claudia/miniconda3/envs/qiime2-2021.2:
#
# Name                    Version                   Build  Channel
ca-certificates           2021.1.19            hecd8cb5_0  
openssl                   1.1.1j               h9ed2024_0  
wget                      1.20.1               h051b688_0  
zlib                      1.2.11               h1de35cc_3  

Thank you!

1 Like

Thanks @claudia.vannini! Do you see the last command you shared, the conda list -n qiime2-2021.2 command? There should be ~100 lines of packages there, including all of the qiime2 packages, but you have none. This kind of thing can happen if your network fails, or you shut down/sleep your computer while installing, etc.

You can try removing the QIIME 2 2021.2 conda env, and reinstalling:

conda env remove -n qiime2-2021.2

Then follow the installation instructions here: Natively installing QIIME 2 — QIIME 2 2021.2.0 documentation

Keep us posted!

:qiime2:

claudia.vannini

Hi @thermokarst,

thanks a lot!! I followed your instructions for removing qiime2, than I re-installed and it seems now it works!
Thank you really very much for your precious help!

Just one thing more: when I enter qiime2, I get a message of one command not found. I tried several qiime2 commands and they all seem to work, so this is just because I’m curious. I copy everything here:

Last login: Thu Mar 25 10:34:40 on ttys000
(base) [email protected] ~ % conda activate qiime2-2021.2
complete:13: command not found: compdef
(qiime2-2021.2) [email protected] ~ % 

Thank you again!

Hi @claudia.vannini, glad to hear you got things working. The compdef error implies that you’re using a different shell than the one that you have configured with miniconda - for example, you configured miniconda to use bash, but are currently using zsh. This isn’t a real problem, it will just prevent you from being able to tab-complete commands (which is pretty annoying).

We can try to pinpoint things, this will take a few round-trip discussions here though. Round 1, please run the following and share the results here:

cd && ls -la

Hello!

I run the command and here’s the result:

(base) [email protected] ~ % cd && ls -la
total 112
-rw-r--r--   1 claudia  staff      0  3 Mar 13:58 --i-data
-rw-r--r--   1 claudia  staff      0  1 Mar 11:10 --i-table
-rw-r--r--   1 claudia  staff      0  1 Mar 11:10 --i-taxonomy
-rw-r--r--   1 claudia  staff      0 19 Feb 16:02 --input-path
-rw-r--r--   1 claudia  staff      0  1 Mar 11:10 --o-collapsed-table
-rw-r--r--   1 claudia  staff      0  3 Mar 13:58 --o-visualization
-rw-r--r--   1 claudia  staff      0 19 Feb 16:02 --output-path
-rw-r--r--   1 claudia  staff      0  1 Mar 11:10 --p-level
-rw-r--r--   1 claudia  staff      0 19 Feb 16:02 --to-tsv
-rw-r--r--   1 claudia  staff      0 19 Feb 16:02 -i
-rw-r--r--   1 claudia  staff      0 19 Feb 16:02 -o
drwxr-xr-x+ 39 claudia  staff   1248 25 Mar 16:29 .
drwxr-xr-x   5 root     admin    160  9 Lug  2020 ..
-r--------   1 claudia  staff      7 17 Nov 09:38 .CFUserTextEncoding
[email protected]  1 claudia  staff  14340 16 Mar 16:44 .DS_Store
drwx------  18 claudia  staff    576 25 Mar 14:09 .Trash
-rw-------   1 claudia  staff     66 17 Mar 14:17 .bash_history
-rw-r--r--   1 root     staff    491 15 Mar 13:11 .bash_profile
drwxr-xr-x   3 claudia  staff     96  3 Mar 12:27 .conda
drwx------   4 claudia  staff    128 17 Mar 10:13 .config
drwx------   3 claudia  staff     96 17 Nov 09:31 .cups
drwx------   3 claudia  staff     96 24 Nov 09:38 .local
drwxr-xr-x   4 claudia  staff    128  3 Mar 12:38 .matplotlib
-rw-r--r--   1 claudia  staff    314 17 Mar 10:13 .tcshrc
-rw-r--r--   1 claudia  staff    180 24 Mar 11:50 .wget-hsts
-rw-r--r--   1 claudia  staff    597 17 Mar 10:13 .xonshrc
-rw-------   1 claudia  staff   8792 25 Mar 16:20 .zsh_history
[email protected]  1 claudia  staff    489 17 Mar 10:12 .zshrc
[email protected]  3 claudia  staff     96 20 Nov 09:18 Applications
drwxr-xr-x  27 claudia  staff    864 18 Gen 12:34 CytoscapeConfiguration
[email protected]  8 claudia  staff    256 25 Mar 14:09 Desktop
drwx------+ 17 claudia  staff    544 22 Mar 17:58 Documents
drwx------+  7 claudia  staff    224 22 Mar 15:59 Downloads
drwx------+ 65 claudia  staff   2080 14 Dic 12:01 Library
drwx------+  4 claudia  staff    128 10 Nov 10:25 Movies
drwx------+  4 claudia  staff    128 17 Nov 14:29 Music
drwx------+  4 claudia  staff    128 10 Nov 12:35 Pictures
drwxr-xr-x+  4 claudia  staff    128 10 Nov 10:22 Public
drwxr-xr-x  18 claudia  staff    576 24 Mar 11:53 miniconda3

Thanks again!

Perfect, thanks! Round 2:

cat ~/.bash_profile
cat ~/.zshrc
cat ~/.xonshrc
echo $SHELL

Hi @thermokarst !

Round 2 done:

(base) [email protected] ~ % cat ~/.bash_profile
cat ~/.zshrc
cat ~/.xonshrc
echo $SHELL

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/claudia/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/claudia/miniconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/claudia/miniconda3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/claudia/miniconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<


# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/claudia/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/claudia/miniconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/claudia/miniconda3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/claudia/miniconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
import sys as _sys
from types import ModuleType as _ModuleType
_mod = _ModuleType("xontrib.conda",
                   "Autogenerated from $(/Users/claudia/miniconda3/bin/conda shell.xonsh hook)")
__xonsh__.execer.exec($("/Users/claudia/miniconda3/bin/conda" "shell.xonsh" "hook"),
                      glbs=_mod.__dict__,
                      filename="$(/Users/claudia/miniconda3/bin/conda shell.xonsh hook)")
_sys.modules["xontrib.conda"] = _mod
del _sys, _mod, _ModuleType
# <<< conda initialize <<<

/bin/zsh
(base) [email protected] ~ % 

Thanks!

Great, thanks @claudia.vannini!

Let’s clean up and start over on the shell configuration:

rm ~/.bash_profile ~/.zshrc ~/.xonshrc
exit

The exit command will require you to close your terminal and open a new open. Please do that!

In a new terminal:

conda init zsh
exit

Again, you’ll need to launch a new terminal - please so so!

Okay, at this point, you should be able to activate your QIIME 2 environment, so give that a try and let us know how it goes.

:qiime2:

Hi!

thank you! I run the commands, opening new terminals as you recommended, but after the second command I got:

[email protected] ~ % conda init zsh
exit
zsh: command not found: conda

[Processo completato]

(Processo completato=process completed)
Then, if I close, open again a new terminal and try to enter qiime2, it does not work any longer!! I am no longer able to enter the environment:

[email protected] ~ % conda activate qiime2-2021.2
zsh: command not found: conda
[email protected] ~ % 

:scream: Help!

Try this, instead!

/Users/claudia/miniconda3/bin/conda init zsh
exit

Done!

Last login: Fri Mar 26 17:04:12 on ttys000
[email protected] ~ % /Users/claudia/miniconda3/bin/conda init zsh
exit
no change     /Users/claudia/miniconda3/condabin/conda
no change     /Users/claudia/miniconda3/bin/conda
no change     /Users/claudia/miniconda3/bin/conda-env
no change     /Users/claudia/miniconda3/bin/activate
no change     /Users/claudia/miniconda3/bin/deactivate
no change     /Users/claudia/miniconda3/etc/profile.d/conda.sh
no change     /Users/claudia/miniconda3/etc/fish/conf.d/conda.fish
no change     /Users/claudia/miniconda3/shell/condabin/Conda.psm1
no change     /Users/claudia/miniconda3/shell/condabin/conda-hook.ps1
no change     /Users/claudia/miniconda3/lib/python3.8/site-packages/xontrib/conda.xsh
no change     /Users/claudia/miniconda3/etc/profile.d/conda.csh
modified      /Users/claudia/.zshrc

==> For changes to take effect, close and re-open your current shell. <==


[Processo completato]

Then I closed, re-open the terminal and tryed again to enter qiime2:

Last login: Fri Mar 26 17:04:23 on ttys000
(base) [email protected] ~ % conda activate qiime2-2021.2
complete:13: command not found: compdef
(qiime2-2021.2) [email protected] ~ % 

Now I am again able to enter qiime2, thanks!! (but still get the misterious “command not found: compdef”)
Anyway, qiime2 is working, which is the important thing!!
Thank you really so much!

Somewhere your computer is trying to load more than one different shell, which is causing this “compdef” issue. I’m not really sure where or how it is happening, but if you can work with your local tech support to resolve it that would be best, I don’t think there is anything else we can do here. Keep us posted!

:qiime2:

Hi @thermokarst,

thank you really very much for your fundamental help! I’ll try to fix the “compdef” issue with technical support here, anyway this does not seem really important (tab-complete commands are not essential to me).
Thanks again!