Problems installing songbird with qiime2-2022.11 on Linux anaconda

Hi all.

I'm trying to use songbird as a plugin for qiime2. I've tried first installing it with qiime2-2022.11 (the latest version) because it seems to be a plugin now. But I kept running into an error regarding tensorflow version when I used conda install:
conda install -c conda-forge -c bioconda qiime2-plugin-songbird

However, when I tried using pip install songbird, it seemed to install correctly. I then did
qiime dev refresh-cache
to get it to be recongized by qiime, but for some reason I got the whole tensorflow --info message show up and then end with a bunch of traceback errors (pasted in full below).

I tried deactivating my env, reopening terminal and reactivating this qiime2-2022.11 environment and now, when I run qiime songbird --help, I get the same tensorflow info message and traceback errors.

I've tried installing this using even older versions of qiime (as suggested on github page), using py3.6 instead of 3.8, but still, the same issue. Can someone help me figure this out? I've been using qiime2 on terminal for a while now, and would really like to use songbird with it.

Thanks!

The error msg I get:

error copy pasted:

QIIME is caching your current deployment for improved performance. This may take a few moments and should only happen once per deployment.
2023-02-18 16:01:03.434815: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-02-18 16:01:03.544803: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2023-02-18 16:01:03.544827: I tensorflow/compiler/xla/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2023-02-18 16:01:04.120880: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory
2023-02-18 16:01:04.120971: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory
2023-02-18 16:01:04.120980: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
Traceback (most recent call last):
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/q2cli/util.py", line 266, in get_plugin_manager
    return qiime2.sdk.PluginManager.reuse_existing()
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/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/deepan/anaconda3/envs/qiime2-2022.11/bin/qiime", line 11, in <module>
    sys.exit(qiime())
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/click/core.py", line 1651, in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/click/core.py", line 1698, in resolve_command
    cmd = self.get_command(ctx, cmd_name)
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/q2cli/commands.py", line 100, in get_command
    plugin = self._plugin_lookup[name]
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/q2cli/commands.py", line 76, in _plugin_lookup
    import q2cli.core.cache
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/q2cli/core/cache.py", line 285, in <module>
    CACHE = DeploymentCache()
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/q2cli/core/cache.py", line 61, in __init__
    self._state = self._get_cached_state(refresh=refresh)
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/q2cli/core/cache.py", line 107, in _get_cached_state
    self._cache_current_state(current_requirements)
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/q2cli/core/cache.py", line 205, in _cache_current_state
    state = self._get_current_state()
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/q2cli/core/cache.py", line 253, in _get_current_state
    plugin_manager = q2cli.util.get_plugin_manager()
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/q2cli/util.py", line 278, in get_plugin_manager
    return qiime2.sdk.PluginManager()
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/qiime2/sdk/plugin_manager.py", line 67, in __new__
    self._init(add_plugins=add_plugins)
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/qiime2/sdk/plugin_manager.py", line 105, in _init
    plugin = entry_point.load()
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2471, in load
    return self.resolve()
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2477, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/songbird/q2/__init__.py", line 2, in <module>
    from ._method import multinomial
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/songbird/q2/_method.py", line 8, in <module>
    from songbird.multinomial import MultRegression
  File "/home/deepan/anaconda3/envs/qiime2-2022.11/lib/python3.8/site-packages/songbird/multinomial.py", line 3, in <module>
    from tensorflow.contrib.distributions import Multinomial, Normal
ModuleNotFoundError: No module named 'tensorflow.contrib'

Hi, we aren't maintaining the bioconda recipe -- the conda-forge recipe is the one that we submitted.

That being said, we recommend the pip installation, since the conda installation of tensorflow has been tricky. To make this work with qiime2, this has only been tested with qiime2=2020.6. See GitHub - biocore/songbird: Vanilla regression methods for microbiome differential abundance analysis

1 Like

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