Picrust2 not recognized

Hello,

I am trying to run qiime picrust2 full-pipeline as I have done in the past, and I am receiving the following error:

Error: QIIME 2 has no plugin/command named 'picrust2'.

I just tried to re-install the latest version of picrust2 to fix the error, but this didn't help. Does anyone have any ideas?

Thank you,
Carli :qiime2:

Good to hear from you again, Carli,

Looks like there's a new version of the q2-picrust2 plugin that supports qiime2-2021.11

Does the install here work for you? What version of Qiime2 and q2-picrust2 do you have installed now?
https://library.qiime2.org/plugins/q2-picrust2/13/

Hi Colin,

Good to hear from you again, too! Right now I am actually having to redo a lot of old analyses (long story :upside_down_face:), so I am currently running on qiime2-2020.6 because that's what I used at the time.

I tried installing the latest version of picrust2 using this method: picrust2/INSTALL.md at master · picrust/picrust2 · GitHub and it worked. I believe I did this within my qiime2-2020.6 conda environment. When I tried the pytest at the end, there were some failures.

I also tried installing the latest version of qiime2 (qiime2-2021.11), but that wasn't working for me.

Sorry, what I did to re-install picrust2 was actually this:

1 Like

Thanks for telling me more.

So... is this working for you, or are you still getting errors with this legacy install?

Sorry I wasn’t clear! After doing all that, I still get the same error as above, which is why I came to the forum for help.

1 Like

Got it.

I'm not sure the perfect method for a legacy install, but I bet it's a combination installing an older version of q2-picrust2 from conda, maybe with some help from the old q2-picrust2 wiki.

Let's see if @gmdouglas is available to provide any advice on installing a version of picrust2 compatible with qiime2-2020.6

Can you also post these test failures to get us started?

Sure - I also am willing to download the latest version of qiime2 to go with the new picrust2, but I was having installation errors with that, too. I will post errors shortly.

Ok. So I'm doing this in a computing cluster for reference, and before doing anything I can see these conda environments:

(base) [[email protected]@bc-login01 ~]$ conda env list
# conda environments:
#
base                  *  /home-1/[email protected]/miniconda3
picrust2                 /home-1/[email protected]/miniconda3/envs/picrust2
qiime2-2019.10           /home-1/[email protected]/miniconda3/envs/qiime2-2019.10
qiime2-2019.7            /home-1/[email protected]/miniconda3/envs/qiime2-2019.7
qiime2-2020.2            /home-1/[email protected]/miniconda3/envs/qiime2-2020.2
qiime2-2020.6            /home-1/[email protected]/miniconda3/envs/qiime2-2020.6

Now when I try and install qiime2-2021.11, I am using the following commands:

wget https://data.qiime2.org/distro/core/qiime2-2021.11-py38-osx-conda.yml
conda env create -n qiime2-2021.11 --file qiime2-2021.11-py38-osx-conda.yml
# OPTIONAL CLEANUP
rm qiime2-2021.11-py38-osx-conda.yml

It tries to install, and then says this error:

[

[email protected]@bc-login01 ~]$ conda env create -n qiime2-2021.11 --file qiime2-2021.11-py38-osx-conda.yml
Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound: 
  - appnope=0.1.2
  - libgfortran=5.0.0

I am trying to run pytest on the new picrust2 install again, but it seems to be stuck.

1 Like

Hey @colinbrislawn, any thoughts on why I can't get the new qiime2 or picrust2 to install?

Hey @cjone228,

The filesystem in your conda env list command looks more like a linux system than OS X, and it appears you are using the OS X environment file. Is that potentially the issue?

Re: picrust2 install, it sounds a bit like the local (non-conda) install isn't placing the plugin in your environment correctly. Running which pip inside your environment can sometimes clarify if that is the case.

2 Likes

Hi @ebolyen ,

Thanks for this! Yes, the first issue about installing qiime2 was my silly mistake - I am using a Mac, but the computing cluster I am using is linux. Oops! So that part is taken care of.

I then installed the most recent version of the q2-picrust2 plugin using these steps: QIIME 2 Library

I tried running my code again after this, and still got the following error:
Error: QIIME 2 has no plugin/command named 'picrust2'.

Not sure what I am doing wrong here... My code for running the picrust2 portion is as follows:

qiime picrust2 full-pipeline \
	--i-table ../analysis/A04-clust-tree/$REGION/otu-table.qza \
	--i-seq ../analysis/A04-clust-tree/$REGION/otu-rep-seqs.qza \
	--o-ko-metagenome $outDir/$REGION/ko.qza \
	--o-ec-metagenome $outDir/$REGION/ec.qza \
	--o-pathway-abundance $outDir/$REGION/pa.qza \
	--output-dir $outDir/$REGION/picrust2 \
	--verbose
1 Like

Thanks for the update @cjone228,

The conda install listed on the library is almost certainly not going to work, but I suspect the manual installation listed here:

May work in this environment. Give it a try and let us know.

Hi @ebolyen,

I tried doing the manual intallation and the installation itself seemed to work. However, when I try running qiime dev refresh-cache or qiime picrust2 --help at the end, I get the following errors:


(qiime2-2021.11) [[email protected]@bc-login03 work]$ cd q2-picrust2-2021.11_0/
(qiime2-2021.11) [[email protected]@bc-login03 q2-picrust2-2021.11_0]$ ls
LICENSE  q2_picrust2  README.md  setup.py
(qiime2-2021.11) [[email protected]@bc-login03 q2-picrust2-2021.11_0]$ pip install -e

Usage:   
  pip install [options] <requirement specifier> [package-index-options] ...
  pip install [options] -r <requirements file> [package-index-options] ...
  pip install [options] [-e] <vcs project url> ...
  pip install [options] [-e] <local project path> ...
  pip install [options] <archive url/path> ...

-e option requires 1 argument
(qiime2-2021.11) [[email protected]@bc-login03 q2-picrust2-2021.11_0]$ pip install -e .
Obtaining file:///scratch/groups/ksandel1/q2-picrust2-2021.11_0
Installing collected packages: q2-picrust2
  Running setup.py develop for q2-picrust2
Successfully installed q2-picrust2
(qiime2-2021.11) [[email protected]@bc-login03 q2-picrust2-2021.11_0]$ qiime dev refresh-cache
QIIME is caching your current deployment for improved performance. This may take a few moments and should only happen once per deployment.
Traceback (most recent call last):
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/bin/qiime", line 11, in <module>
    sys.exit(qiime())
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/builtin/dev.py", line 31, in refresh_cache
    import q2cli.core.cache
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/core/cache.py", line 406, in <module>
    CACHE = DeploymentCache()
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/core/cache.py", line 61, in __init__
    self._state = self._get_cached_state(refresh=refresh)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/core/cache.py", line 107, in _get_cached_state
    self._cache_current_state(current_requirements)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/core/cache.py", line 200, in _cache_current_state
    state = self._get_current_state()
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/core/cache.py", line 238, in _get_current_state
    plugin_manager = qiime2.sdk.PluginManager()
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/sdk/plugin_manager.py", line 54, in __new__
    self._init(add_plugins=add_plugins)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/sdk/plugin_manager.py", line 81, in _init
    plugin = entry_point.load()
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2461, in load
    return self.resolve()
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2467, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/scratch/groups/ksandel1/q2-picrust2-2021.11_0/q2_picrust2/__init__.py", line 9, in <module>
    from ._full_pipeline import full_pipeline
  File "/scratch/groups/ksandel1/q2-picrust2-2021.11_0/q2_picrust2/_full_pipeline.py", line 7, in <module>
    from picrust2.default import (default_ref_dir, default_tables,
ImportError: cannot import name 'default_ref_dir'

If I try running which pip while I am in the conda activated qiime2-2021.11 environment, I still get this:


(qiime2-2021.11) [[email protected]@bc-login03 q2-picrust2-2021.11_0]$ which pip
~/miniconda3/envs/qiime2-2020.6/bin/pip

I'm not clear on what which pip does but this doesn't seem right. Any ideas?

Thanks,
Carli

Hey @cjone228,

Unfortunately there isn't a version of the plugin for that version of QIIME 2 (you can see the compatible versions here: Releases · gavinmdouglas/q2-picrust2 · GitHub)

I think your best best is to export your files out of QIIME 2 and to run the standalone PICRUSt2 in a separate conda environment. You can see this tutorial for how to run the standalone version: PICRUSt2 Tutorial (v2.4.2) · picrust/picrust2 Wiki · GitHub

Sorry I can't be more help!

Cheers,

Gavin

1 Like

I see... I'd really like to use the q2 picrust2 plugin if possible, so I'm trying to figure out why it wasn't working in the first place (because it had worked before in 2020)?

I'm now trying to install a release of qiime2 that could be compatible with a release of q2 picrust2. I'm going to try qiime2-2021.2 with q2-picrust2 2021.2_0 - will these be compatible??

Yes that should work!

Ok, thanks!

I just tried installing qiime2-2021.2, and that worked fine. However, it seems like somehow everything is stuck inside my qiime2-2020.6 env (not sure if this is the right terminology)?

See below for what happens when I try and activate the new qiime2-2021.2 conda environment:

(base) [[email protected]@bc-login03 ~]$ conda activate qiime2-2021.2
QIIME is caching your current deployment for improved performance. This may take a few moments and should only happen once per deployment.
Traceback (most recent call last):
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/bin/qiime", line 11, in <module>
    sys.exit(qiime())
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 781, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 700, in make_context
    self.parse_args(ctx, args)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/click/command.py", line 43, in parse_args
    return super().parse_args(ctx, args)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 1209, in parse_args
    echo(ctx.get_help(), color=ctx.color)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 570, in get_help
    return self.command.get_help(self)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 975, in get_help
    self.format_help(ctx, formatter)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 1003, in format_help
    self.format_options(ctx, formatter)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/click/command.py", line 157, in format_options
    for subcommand in self.list_commands(ctx):
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/commands.py", line 92, in list_commands
    plugins = sorted(self._plugin_lookup)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/commands.py", line 76, in _plugin_lookup
    import q2cli.core.cache
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/core/cache.py", line 406, in <module>
    CACHE = DeploymentCache()
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/core/cache.py", line 61, in __init__
    self._state = self._get_cached_state(refresh=refresh)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/core/cache.py", line 107, in _get_cached_state
    self._cache_current_state(current_requirements)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/core/cache.py", line 200, in _cache_current_state
    state = self._get_current_state()
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/core/cache.py", line 238, in _get_current_state
    plugin_manager = qiime2.sdk.PluginManager()
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/sdk/plugin_manager.py", line 54, in __new__
    self._init(add_plugins=add_plugins)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/sdk/plugin_manager.py", line 81, in _init
    plugin = entry_point.load()
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2461, in load
    return self.resolve()
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2467, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/scratch/groups/ksandel1/q2-picrust2-2021.2_0/q2_picrust2/__init__.py", line 9, in <module>
    from ._full_pipeline import full_pipeline
  File "/scratch/groups/ksandel1/q2-picrust2-2021.2_0/q2_picrust2/_full_pipeline.py", line 7, in <module>
    from picrust2.default import (default_ref_dir, default_tables,
ImportError: cannot import name 'default_ref_dir'
(qiime2-2021.2) [[email protected]@bc-login03 ~]$ which pip
~/miniconda3/envs/qiime2-2020.6/bin/pip
(qiime2-2021.2) [[email protected]@bc-login03 ~]$ conda activate qiime2-2020.6
QIIME is caching your current deployment for improved performance. This may take a few moments and should only happen once per deployment.
Traceback (most recent call last):
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/bin/qiime", line 11, in <module>
    sys.exit(qiime())
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 781, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 700, in make_context
    self.parse_args(ctx, args)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/click/command.py", line 43, in parse_args
    return super().parse_args(ctx, args)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 1209, in parse_args
    echo(ctx.get_help(), color=ctx.color)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 570, in get_help
    return self.command.get_help(self)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 975, in get_help
    self.format_help(ctx, formatter)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/click/core.py", line 1003, in format_help
    self.format_options(ctx, formatter)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/click/command.py", line 157, in format_options
    for subcommand in self.list_commands(ctx):
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/commands.py", line 92, in list_commands
    plugins = sorted(self._plugin_lookup)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/commands.py", line 76, in _plugin_lookup
    import q2cli.core.cache
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/core/cache.py", line 406, in <module>
    CACHE = DeploymentCache()
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/core/cache.py", line 61, in __init__
    self._state = self._get_cached_state(refresh=refresh)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/core/cache.py", line 107, in _get_cached_state
    self._cache_current_state(current_requirements)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/core/cache.py", line 200, in _cache_current_state
    state = self._get_current_state()
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/core/cache.py", line 238, in _get_current_state
    plugin_manager = qiime2.sdk.PluginManager()
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/sdk/plugin_manager.py", line 54, in __new__
    self._init(add_plugins=add_plugins)
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/sdk/plugin_manager.py", line 81, in _init
    plugin = entry_point.load()
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2461, in load
    return self.resolve()
  File "/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2467, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/scratch/groups/ksandel1/q2-picrust2-2021.2_0/q2_picrust2/__init__.py", line 9, in <module>
    from ._full_pipeline import full_pipeline
  File "/scratch/groups/ksandel1/q2-picrust2-2021.2_0/q2_picrust2/_full_pipeline.py", line 7, in <module>
    from picrust2.default import (default_ref_dir, default_tables,
ImportError: cannot import name 'default_ref_dir'

and this is what happens when I navigate to the base environment and then input "which pip":

(qiime2-2020.6) [[email protected]@bc-login03 ~]$ conda env list
# conda environments:
#
base                     /home-1/[email protected]/miniconda3
picrust2                 /home-1/[email protected]/miniconda3/envs/picrust2
qiime2-2019.10           /home-1/[email protected]/miniconda3/envs/qiime2-2019.10
qiime2-2019.7            /home-1/[email protected]/miniconda3/envs/qiime2-2019.7
qiime2-2020.2            /home-1/[email protected]/miniconda3/envs/qiime2-2020.2
qiime2-2020.6         *  /home-1/[email protected]/miniconda3/envs/qiime2-2020.6
qiime2-2021.11           /home-1/[email protected]/miniconda3/envs/qiime2-2021.11
qiime2-2021.2            /home-1/[email protected]/miniconda3/envs/qiime2-2021.2

(qiime2-2020.6) [[email protected]@bc-login03 ~]$ conda activate base
(base) [[email protected]@bc-login03 ~]$ which pip
~/miniconda3/envs/qiime2-2020.6/bin/pip

Hmm yes it seems like there must be something wrong with your conda installation. If you log out and log back in again what's the output of these commands (before and after activating the qiime2-2021.2 environment)

echo $PYTHONPATH

And:

echo $PATH

Hi @gmdouglas,

Here's what happens when I input those commands:

(base) [[email protected]@bc-login02 ~]$ echo $PYTHONPATH

(base) [[email protected]@bc-login02 ~]$ echo $PATH
/home-1/[email protected]/miniconda3/envs/qiime2-2020.6/bin:/home-1/[email protected]/miniconda3/bin:/home-1/[email protected]/miniconda3/condabin:/software/apps/mpi/openmpi/3.1/gcc/5.5/bin:/software/apps/compilers/gcc/5.5.0/bin:/software/apps/marcc/bin:/software/centos7/bin:/software/centos7/sbin:/software/apps/slurm/current/sbin:/software/apps/slurm/current/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/ibutils/bin:/home-1/[email protected]/.local/bin:/home-1/[email protected]/bin

Not sure where to go from here. I'm not sure why my issue even started in the first place, because I was using qiime2-2020.6 and the q2 picrust2 plugin that had worked together before!

Carli