-
Have you searched for the problem on the forum? It is rare that we see a new question asked, so make sure you do your homework before asking for us to commit our time to helping you.
yes -
Have you reviewed the QIIME 2 Forum Glossary?
yes -
Version of QIIME 2 you are running, and how it is installed (e.g. Virtualbox, conda, etc.)
2025.4, installed via mamba -
What is the exact command or commands you ran? Copy and paste please.
in a jupyter notebook with the env as kernel
silva_seq_artifact = "silva-138.2-rankprop-ssu-nr99-seqs-cleaned.qza"
seq = q2.Artifact.load(silva_seq_artifact)
- What is the exact error message? If you didn't run the command with the
--verbose
flag, please re-run and copy-and-paste the results.
tl;dr : PackageNotInstalledError: The R package "phyloseq" is not installed.
I checked if phyloseq was available in the R env that is installed in the Qiime2 env
It was not, so I installed it and checked if it worked --> OK
I guess 'R' from the environment might not be the R instance actually used.
How to check this?
As a workaround I'm currently just unzipping the artifact and use BioPython to load the seqs.
(main goal, get a histogram of the length of silva seqs for a particular clade)
---------------------------------------------------------------------------
PackageNotInstalledError Traceback (most recent call last)
Cell In[13], line 1
----> 1 seq = q2.Artifact.load(silva_seq_artifact)
File /webapp/tools/miniconda/miniconda3-py312_24.7.1-0/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/sdk/result.py:83, in Result.load(cls, filepath)
81 if not archiver:
82 try:
---> 83 archiver = archive.Archiver.load(filepath)
84 except OSError as e:
85 if e.errno == 28:
File /webapp/tools/miniconda/miniconda3-py312_24.7.1-0/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/core/archive/archiver.py:387, in Archiver.load(cls, filepath)
382 process_alias, data_path = \
383 cache._rename_to_data(archive.uuid, path)
384 rec = ArchiveRecord(
385 data_path, data_path / archive.VERSION_FILE, archive.uuid,
386 archive.version, archive.framework_version)
--> 387 ref = cls(data_path, process_alias, Format(rec), cache)
388 return ref
389 # We really just want to kill these paths if anything at all goes wrong
390 # Exceptions including keyboard interrupts are re-raised
File /webapp/tools/miniconda/miniconda3-py312_24.7.1-0/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/core/archive/format/v7_0.py:179, in ArchiveFormat.__init__(self, archive_record)
178 def __init__(self, archive_record):
--> 179 super().__init__(archive_record)
181 self.annotations_dir = \
182 archive_record.root / self.ANNOTATIONS_DIR
File /webapp/tools/miniconda/miniconda3-py312_24.7.1-0/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/core/archive/format/v1.py:32, in ArchiveFormat.__init__(self, archive_record)
31 def __init__(self, archive_record):
---> 32 super().__init__(archive_record)
34 self.provenance_dir = archive_record.root / self.PROVENANCE_DIR
File /webapp/tools/miniconda/miniconda3-py312_24.7.1-0/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/core/archive/format/v0.py:75, in ArchiveFormat.__init__(self, archive_record)
73 self.uuid = _uuid.UUID(uuid)
74 self.type = sdk.parse_type(type)
---> 75 self.format = sdk.parse_format(format)
77 self.path = path
78 self.data_dir = path / self.DATA_DIR
File /webapp/tools/miniconda/miniconda3-py312_24.7.1-0/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/sdk/util.py:109, in parse_format(format_str)
106 if format_str is None:
107 return None
--> 109 pm = qiime2.sdk.PluginManager()
110 try:
111 format_record = pm.formats[format_str]
File /webapp/tools/miniconda/miniconda3-py312_24.7.1-0/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/sdk/plugin_manager.py:67, in PluginManager.__new__(cls, add_plugins)
65 cls.__instance = self
66 try:
---> 67 self._init(add_plugins=add_plugins)
68 except Exception:
69 cls.__instance = None
File /webapp/tools/miniconda/miniconda3-py312_24.7.1-0/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/sdk/plugin_manager.py:105, in PluginManager._init(self, add_plugins)
103 project_name = entry_point.name
104 package = entry_point.value.split('.')[0]
--> 105 plugin = entry_point.load()
107 self.add_plugin(plugin, package, project_name,
108 consistency_check=False)
110 self._consistency_check()
File /webapp/tools/miniconda/miniconda3-py312_24.7.1-0/envs/qiime2-amplicon-2025.4/lib/python3.10/importlib/metadata/__init__.py:171, in EntryPoint.load(self)
166 """Load the entry point from its definition. If only a module
167 is indicated by the value, return that module. Otherwise,
168 return the named object.
169 """
170 match = self.pattern.match(self.value)
--> 171 module = import_module(match.group('module'))
172 attrs = filter(None, (match.group('attr') or '').split('.'))
173 return functools.reduce(getattr, attrs, module)
File /webapp/tools/miniconda/miniconda3-py312_24.7.1-0/envs/qiime2-amplicon-2025.4/lib/python3.10/importlib/__init__.py:126, in import_module(name, package)
124 break
125 level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)
File <frozen importlib._bootstrap>:1050, in _gcd_import(name, package, level)
File <frozen importlib._bootstrap>:1027, in _find_and_load(name, import_)
File <frozen importlib._bootstrap>:992, in _find_and_load_unlocked(name, import_)
File <frozen importlib._bootstrap>:241, in _call_with_frames_removed(f, *args, **kwds)
File <frozen importlib._bootstrap>:1050, in _gcd_import(name, package, level)
File <frozen importlib._bootstrap>:1027, in _find_and_load(name, import_)
File <frozen importlib._bootstrap>:1006, in _find_and_load_unlocked(name, import_)
File <frozen importlib._bootstrap>:688, in _load_unlocked(spec)
File <frozen importlib._bootstrap_external>:883, in exec_module(self, module)
File <frozen importlib._bootstrap>:241, in _call_with_frames_removed(f, *args, **kwds)
File /webapp/tools/miniconda/miniconda3-py312_24.7.1-0/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/q2_composition/__init__.py:18
16 from ._ancom import ancom
17 from ._ancombc import ancombc
---> 18 from ._ancombc2 import ancombc2, ancombc2_visualizer
19 from ._dataloaf_tabulate import tabulate
20 from ._diff_abundance_plots import da_barplot
File /webapp/tools/miniconda/miniconda3-py312_24.7.1-0/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/q2_composition/_ancombc2.py:34
32 r_base = importr('base')
33 r_stats = importr('stats')
---> 34 r_phyloseq = importr('phyloseq')
35 r_ancombc2 = importr('ANCOMBC')
37 rpy2_logger.setLevel(logging.ERROR)
File /webapp/tools/miniconda/miniconda3-py312_24.7.1-0/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/rpy2/robjects/packages.py:472, in importr(name, lib_loc, robject_translations, signature_translation, suppress_messages, on_conflict, symbol_r2python, symbol_resolve, data)
440 """ Import an R package.
441
442 Arguments:
(...)
468
469 """
471 if not isinstalled(name, lib_loc=lib_loc):
--> 472 raise PackageNotInstalledError(
473 'The R package "%s" is not installed.' % name
474 )
476 if suppress_messages:
477 ok = quiet_require(name, lib_loc=lib_loc)
PackageNotInstalledError: The R package "phyloseq" is not installed.