Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'Emperor' object has no attribute 'render_base_dependencies' #802

Open
fedarko opened this issue Jun 22, 2021 · 2 comments

Comments

@fedarko
Copy link
Contributor

fedarko commented Jun 22, 2021

While I was running Empress to generate an Empire plot (just using the normal moving pictures data), I kept getting this error:

Traceback (most recent call last):
  File "/home/marcus/Software/miniconda2/envs/qiime2-2021.2/lib/python3.6/site-packages/q2cli/commands.py", line 329, in __call__
    results = action(**arguments)
  File "</home/marcus/.local/lib/python3.6/site-packages/decorator.py:decorator-gen-547>", line 2, in community_plot
  File "/home/marcus/Software/miniconda2/envs/qiime2-2021.2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
    output_types, provenance)
  File "/home/marcus/Software/miniconda2/envs/qiime2-2021.2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 452, in _callable_executor_
    ret_val = self._callable(output_dir=temp_dir, **view_args)
  File "/home/marcus/Dropbox/Work/KnightLab/Empress/fedarko/empress/empress/_plot.py", line 53, in community_plot
    save_viz(viz, output_dir)
  File "/home/marcus/Dropbox/Work/KnightLab/Empress/fedarko/empress/empress/_plot_utils.py", line 52, in save_viz
    htmlfile.write(str(viz))
  File "/home/marcus/Dropbox/Work/KnightLab/Empress/fedarko/empress/empress/core.py", line 269, in __str__
    return self.make_empress()
  File "/home/marcus/Dropbox/Work/KnightLab/Empress/fedarko/empress/empress/core.py", line 294, in make_empress
    data = self.to_dict()
  File "/home/marcus/Dropbox/Work/KnightLab/Empress/fedarko/empress/empress/core.py", line 391, in to_dict
    data_to_render.update(self._scavenge_emperor())
  File "/home/marcus/Dropbox/Work/KnightLab/Empress/fedarko/empress/empress/core.py", line 424, in _scavenge_emperor
    emperor_base_dependencies = self._emperor.render_base_dependencies()
AttributeError: 'Emperor' object has no attribute 'render_base_dependencies'

This was within a QIIME 2 2021.2 conda environment, with emperor 1.0.2 installed. I was pretty confused, since v1.0.2 should have render_base_dependencies installed. (For reference, this error was also documented on the Q2 forums a few months back here.) However, I was running this within a conda environment I'd been using for quite some time; I'm pretty sure this Q2 environment worked fine with Empress/Emperor for a while. Maybe something I installed messed things up...?

Installing emperor 1.0.3 fixed the problem, strangely (now I can generate Empire plots without a problem). Even more strangely, installing emperor 1.0.2 again (replacing v1.0.3 with v1.0.2) still fixed the problem?

I'm not sure of the cause of this error, but I wanted to document it. There might be some sort of weird inconsistency issue that pops up in QIIME 2 environments when certain things go wrong; it seems like reinstalling Emperor >= 1.0.2 consistently fixes the problem. If other folks start running into this error, we could investigate further.

@ElDeveloper
Copy link
Member

This sounds like a python package installation issue. If you are able to reproduce the issue, are you able to import the Emperor object and confirm that it is missing the necessary attributes? In that case would you be able to run:

import emperor
print(emperor.__file__, emperor.__version__)

@fedarko
Copy link
Contributor Author

fedarko commented Jul 17, 2021

Eesh - I tried with few old Q2 environments (plus a freshly installed Q2 2021.2 environment) and haven't been able to reproduce the problem yet (installing Empress automatically installed the right Emperor version, and I've been able to generate Empire plots without a problem)... now I'm wishing I hadn't fixed this for myself!

If I run into this problem again I'll make sure to run the debug code you listed above and report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants