RESCRIPT install: "ModuleNotFoundError: No module named 'q2_types_genomics'"

I am running qiime2-2023.2 with Miniconda/22.11.1-1 on a HPC (remote server).

I have searched and troubleshooted this rescript issue using previous posts, but I still get the same error after installing rescript, I have attempted this three ways:

  1. Installing in the qiime2 environment per Bokulich Lab GITHub instruction:
conda activate qiime2-2023.2
conda install -c conda-forge -c bioconda -c qiime2 -c https://packages.qiime2.org/qiime2/2023.5/tested/ -c defaults \
  xmltodict 'q2-types-genomics>2023.2' ncbi-datasets-pylib
pip install git+https://github.com/bokulich-lab/RESCRIPt.git
  1. SoilRotifer's solution from a previous post:
conda activate qiime2-2023.2
conda create -y -n rescript
conda activate rescript
conda install \
  -c conda-forge -c bioconda -c qiime2 -c https://packages.qiime2.org/qiime2/2023.5/tested/ -c defaults \
  qiime2 q2cli q2templates q2-types q2-longitudinal q2-feature-classifier 'q2-types-genomics>2023.2' \
  "pandas>=0.25.3" xmltodict ncbi-datasets-pylib

pip install git+https://github.com/bokulich-lab/RESCRIPt.git
  1. Minimal RESCRIPt environment (Through Bolkulich Lab GITHub):
conda create -y -n rescript
conda activate rescript
conda install \
  -c conda-forge -c bioconda -c qiime2 -c https://packages.qiime2.org/qiime2/2023.5/tested/ -c defaults \
  qiime2 q2cli q2templates q2-types q2-longitudinal q2-feature-classifier 'q2-types-genomics>2023.2' \
  "pandas>=0.25.3" xmltodict ncbi-datasets-pylib

pip install git+https://github.com/bokulich-lab/RESCRIPt.git

I have had no other issues with qiime2 and dependencies on the platform. Additionally each time I run qiime2 after installing rescript, this message is deployed:

QIIME is caching your current deployment for improved performance. This may take a few moments and should only happen once per deployment.

followed by a lengthy traceback

Traceback Details

Traceback (most recent call last):
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/q2cli/util.py", line 279, in get_plugin_manager
return qiime2.sdk.PluginManager.reuse_existing()
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/qiime2/sdk/plugin_manager.py", line 58, in reuse_existing
raise UninitializedPluginManagerError
qiime2.sdk.plugin_manager.UninitializedPluginManagerError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/bin/qiime", line 11, in
sys.exit(qiime())
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/click/core.py", line 1077, in main
with self.make_context(prog_name, args, **extra) as ctx:
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/click/core.py", line 943, in make_context
self.parse_args(ctx, args)
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/q2cli/click/command.py", line 43, in parse_args
return super().parse_args(ctx, args)
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/click/core.py", line 1644, in parse_args
rest = super().parse_args(ctx, args)
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/click/core.py", line 1408, in parse_args
value, args = param.handle_parse_result(ctx, opts, args)
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/click/core.py", line 2400, in handle_parse_result
value = self.process_value(ctx, value)
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/click/core.py", line 2362, in process_value
value = self.callback(ctx, self, value)
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/click/core.py", line 1300, in show_help
echo(ctx.get_help(), color=ctx.color)
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/click/core.py", line 704, in get_help
return self.command.get_help(self)
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/click/core.py", line 1325, in get_help
self.format_help(ctx, formatter)
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/click/core.py", line 1358, in format_help
self.format_options(ctx, formatter)
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/q2cli/click/command.py", line 157, in format_options
for subcommand in self.list_commands(ctx):
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/q2cli/commands.py", line 92, in list_commands
plugins = sorted(self._plugin_lookup)
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/q2cli/commands.py", line 76, in _plugin_lookup
import q2cli.core.cache
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/q2cli/core/cache.py", line 285, in
CACHE = DeploymentCache()
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/q2cli/core/cache.py", line 61, in init
self._state = self._get_cached_state(refresh=refresh)
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/q2cli/core/cache.py", line 107, in _get_cached_state
self._cache_current_state(current_requirements)
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/q2cli/core/cache.py", line 205, in _cache_current_state
state = self._get_current_state()
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/q2cli/core/cache.py", line 253, in _get_current_state
plugin_manager = q2cli.util.get_plugin_manager()
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/q2cli/util.py", line 291, in get_plugin_manager
return qiime2.sdk.PluginManager()
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/qiime2/sdk/plugin_manager.py", line 67, in new
self._init(add_plugins=add_plugins)
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/qiime2/sdk/plugin_manager.py", line 105, in _init
plugin = entry_point.load()
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/pkg_resources/init.py", line 2518, in load
return self.resolve()
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/pkg_resources/init.py", line 2524, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/rescript/plugin_setup.py", line 11, in

that ultimately ends with....

File "/home/mkweber_smith_edu/.conda/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/rescript/plugin_setup.py", line 11, in
from q2_types_genomics.genome_data import GenomeData, Loci, Proteins
ModuleNotFoundError: No module named 'q2_types_genomics'

simple commands like "qiime --help" will even trigger this deployment post-rescript installation. This particularly happens after the install source command:

pip install git+https://github.com/bokulich-lab/RESCRIPt.git

I have tried to use "wget" and other older "hard mode" means of importing Silva, but links listed in the rescript tutorial seem to be outdated-- and ultimately, I would like to use rescript and it's other non-import tools.

Hi @mkweber, hopefully we can get this sorted out for you.

I just installed RESCRIPt into one of my older qiime2-2023.2 environments, and was able to run QIIME 2 and RESCRIPt successfully.

Some of the error outputs are a bit confusing as they reference qiime2-amplicon-2023.9 but your commands reference qiime2-2023.2. :man_shrugging:

One thing I noticed in our README, is that we forgot to update the conda activate qiime2-2023.2 line. It should be conda activate qiime2-2023.5 for that specific example. That is, the "http ... tested" folder we point to, should match the version of QIIME 2 being used. So, your command should be:

conda activate qiime2-2023.2
conda create -y -n rescript
conda activate rescript
conda install \
  -c conda-forge -c bioconda -c qiime2 -c https://packages.qiime2.org/qiime2/2023.2/tested/ -c defaults \
  qiime2 q2cli q2templates q2-types q2-longitudinal q2-feature-classifier 'q2-types-genomics>2023.2' \
  "pandas>=0.25.3" xmltodict ncbi-datasets-pylib

pip install git+https://github.com/bokulich-lab/RESCRIPt.git

If you are going to run the latest version of QIIME 2 (qiime2-amplicon-2023.9) you'll have to use the commands outlined here.

We'll get that README updated! :+1:

I just checked to see if these links under "hard mode" are still valid. It appears they are and I've been able download all of the files with wget. Perhaps there is a connection or firewall issue? Others had connection issues to SILVA a few days ago, perhaps their servers were down when you attempted to access the files?

1 Like

it sometimes takes another set of eyes! I think incompatible qiime versions are the issue!

2 Likes

I totally hear you on that! :slight_smile:

Glad you got it working! :sparkler:

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.