ImportError: dynamic module does not define module export function (PyInit__path)

I am running following command to cretics .qzv file from metadata.tsv and getting following error. I am not sure what is the issue and how to resolve it.

Many thanks.

Command: qiime metadata tabulate --m-input-file /home/metadata2.tsv --o-visualization /home/tabulated-fasting-metadata.qzv

Traceback (most recent call last):
File “/opt/conda/envs/qiime2-2020.2/bin/qiime”, line 11, in
sys.exit(qiime())
File “/opt/conda/envs/qiime2-2020.2/lib/python3.6/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/opt/conda/envs/qiime2-2020.2/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/opt/conda/envs/qiime2-2020.2/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/conda/envs/qiime2-2020.2/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/conda/envs/qiime2-2020.2/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/conda/envs/qiime2-2020.2/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/conda/envs/qiime2-2020.2/lib/python3.6/site-packages/q2cli/commands.py”, line 305, in call
action = self._get_action()
File “/opt/conda/envs/qiime2-2020.2/lib/python3.6/site-packages/q2cli/commands.py”, line 270, in _get_action
pm = qiime2.sdk.PluginManager()
File “/opt/conda/envs/qiime2-2020.2/lib/python3.6/site-packages/qiime2/sdk/plugin_manager.py”, line 54, in new
self._init(add_plugins=add_plugins)
File “/opt/conda/envs/qiime2-2020.2/lib/python3.6/site-packages/qiime2/sdk/plugin_manager.py”, line 81, in _init
plugin = entry_point.load()
File “/opt/conda/envs/qiime2-2020.2/lib/python3.6/site-packages/pkg_resources/init.py”, line 2445, in load
return self.resolve()
File “/opt/conda/envs/qiime2-2020.2/lib/python3.6/site-packages/pkg_resources/init.py”, line 2451, in resolve
module = import(self.module_name, fromlist=[‘name’], level=0)
File “/opt/conda/envs/qiime2-2020.2/lib/python3.6/site-packages/q2_vsearch/plugin_setup.py”, line 12, in
import q2_vsearch._cluster_features
File “/opt/conda/envs/qiime2-2020.2/lib/python3.6/site-packages/q2_vsearch/_cluster_features.py”, line 15, in
import skbio
File “/apps/qiime/1.9.1/lib/python2.7/site-packages/skbio/init.py”, line 15, in
import skbio.io
File “/apps/qiime/1.9.1/lib/python2.7/site-packages/skbio/io/init.py”, line 309, in
import_module(‘skbio.io.clustal’)
File “/opt/conda/envs/qiime2-2020.2/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “/apps/qiime/1.9.1/lib/python2.7/site-packages/skbio/io/clustal.py”, line 123, in
from skbio.alignment import Alignment
File “/apps/qiime/1.9.1/lib/python2.7/site-packages/skbio/alignment/init.py”, line 230, in
from ._alignment import Alignment, SequenceCollection, StockholmAlignment
File “/apps/qiime/1.9.1/lib/python2.7/site-packages/skbio/alignment/_alignment.py”, line 21, in
from skbio.stats.distance import DistanceMatrix
File “/apps/qiime/1.9.1/lib/python2.7/site-packages/skbio/stats/distance/init.py”, line 193, in
from ._base import (DissimilarityMatrixError, DistanceMatrixError,
File “/apps/qiime/1.9.1/lib/python2.7/site-packages/skbio/stats/distance/_base.py”, line 16, in
import matplotlib.pyplot as plt
File “/apps/qiime/1.9.1/lib/python2.7/site-packages/matplotlib-1.4.3-py2.7-linux-x86_64.egg/matplotlib/pyplot.py”, line 27, in
import matplotlib.colorbar
File “/apps/qiime/1.9.1/lib/python2.7/site-packages/matplotlib-1.4.3-py2.7-linux-x86_64.egg/matplotlib/colorbar.py”, line 32, in
import matplotlib.artist as martist
File “/apps/qiime/1.9.1/lib/python2.7/site-packages/matplotlib-1.4.3-py2.7-linux-x86_64.egg/matplotlib/artist.py”, line 12, in
from .transforms import Bbox, IdentityTransform, TransformedBbox,
File “/apps/qiime/1.9.1/lib/python2.7/site-packages/matplotlib-1.4.3-py2.7-linux-x86_64.egg/matplotlib/transforms.py”, line 39, in
from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: dynamic module does not define module export function (PyInit__path)

Hi @Shakuntla_Gondalia!
I haven’t seen this error message before, so this is a bit of a long shot, but here goes.

It looks like python 2.7 is getting pulled in here, while QIIME 2 needs v3.6. This may be QIIME 1’s fault. Is QIIME 1 installed in your 2020.2 environment, by any chance? Or maybe it’s installed globally, and is interfering?

Best,
Chris :frog:

2 Likes

Hi @ChrisKeefe ,

Yes it has QIIME1.9.1 installed and set as default in global environment. When I am loading QIIME2020.2 to create local environment it having QIIME 1.9.1 as well. I am not sure how this can be changed, any suggestions?

Thanks,
Shaku.

@Shakuntla_Gondalia, can share the results of the env command with us (both before and after activating your QIIME 2 conda environment) so we can take a look?

Depending on how things are configured, we may be able to suggest adjustments that will allow you to keep both pieces of software active and working properly.

Hi @ChrisKeefe, its was an issue of having older version of QIIME in the environment. Once is was unloaded the command worked just fine.
Thanks,
Shaku.