# Error in qiime feature-table summarize

**URL:** <https://forum.qiime2.org/t/error-in-qiime-feature-table-summarize/308>\
**Category:** User Support\
**Tags:** matplotlib\
**Created:** [February 6, 2017, 1:05pm UTC](https://forum.qiime2.org/t/error-in-qiime-feature-table-summarize/308 "2017-02-06T13:05:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ErikaGanda](https://forum.qiime2.org/user_avatar/forum.qiime2.org/erikaganda/32/29_2.png) [@ErikaGanda](https://forum.qiime2.org/u/ErikaGanda)\
**Post date:** [February 6, 2017, 1:05pm UTC](https://forum.qiime2.org/t/error-in-qiime-feature-table-summarize/308/1 "2017-02-06T13:05:49Z")

</div>

Good morning,

When trying to summarize a merged table from 4 denoised sequence variant data I got the following error:

What is this `DISPLAY` variable? And how can I fix it?

Thank you!

```bash
(qiime2) ekg43@thompson:~/SCC/Dada$ qiime feature-table summarize --i-table table1234.qza --o-visualization table1234
Traceback (most recent call last):
  File "/home/ekg43/miniconda3/envs/qiime2/bin/qiime", line 6, in <module>
    sys.exit(q2cli. __main__.qiime())
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 86, in augment_usage_errors
    yield
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/q2cli-0.0.6-py3.5.egg/q2cli/commands.py", line 210, in __call__
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/util.py", line 27, in redirected_stdio
    yield
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/util.py", line 53, in _redirected_fd
    yield stdio # allow code to be run with the redirected stdio
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/util.py", line 25, in redirected_stdio
    yield
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/util.py", line 53, in _redirected_fd
    yield stdio # allow code to be run with the redirected stdio
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/util.py", line 25, in redirected_stdio
    yield
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/q2cli-0.0.6-py3.5.egg/q2cli/commands.py", line 210, in __call__
  File "<decorator-gen-211>", line 2, in summarize
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/core/callable.py", line 227, in callable_wrapper
    output_types, provenance)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/core/callable.py", line 426, in _callable_executor_
    ret_val = callable(output_dir=temp_dir, **view_args)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/q2_feature_table-0.0.6-py3.5.egg/q2_feature_table/_summarize/_visualizer.py", line 47, in summarize
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/seaborn/distributions.py", line 162, in distplot
    ax = plt.gca()
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/matplotlib/pyplot.py", line 928, in gca
    return gcf().gca(**kwargs)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/matplotlib/pyplot.py", line 578, in gcf
    return figure()
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/matplotlib/pyplot.py", line 527, in figure
    **kwargs)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/matplotlib/backends/backend_qt4agg.py", line 46, in new_figure_manager
    return new_figure_manager_given_figure(num, thisFig)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/matplotlib/backends/backend_qt4agg.py", line 53, in new_figure_manager_given_figure
    canvas = FigureCanvasQTAgg(figure)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/matplotlib/backends/backend_qt4agg.py", line 76, in __init__
    FigureCanvasQT. __init__ (self, figure)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/matplotlib/backends/backend_qt4.py", line 68, in __init__
    _create_qApp()
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/matplotlib/backends/backend_qt5.py", line 138, in _create_qApp
    raise RuntimeError('Invalid DISPLAY variable')
RuntimeError: Invalid DISPLAY variable

```

---

<div class="post-metadata">

**Author:** ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)\
**Post date:** [February 6, 2017, 3:07pm UTC](https://forum.qiime2.org/t/error-in-qiime-feature-table-summarize/308/2 "2017-02-06T15:07:55Z")

</div>

Hi @ErikaGanda, it looks like you might be running on a headless machine (as in, no monitor connected)? If so, you need to [configure your matplotlib backend](https://forum.qiime2.org/t/qiime2-plugins-not-found-though-they-are-installed/112/2) to use a renderer that supports headless operations (e.g. `Agg`):

```bash
echo "backend: Agg" > ~/.config/matplotlib/matplotlibrc

```

Please note, if this is in fact a headless machine, `qiime tools view` will not work for viewing your `QZV` files (because there is no display to use!), so please consider one of the alternatives linked to here:

> [@\`qiime tools view\` on headless server](https://forum.qiime2.org/t/qiime-tools-view-on-headless-server/113/2):
>
> Hi @steviep, This issue is related to the headless server issue [from before](https://forum.qiime2.org/t/qiime2-plugins-not-found-though-they-are-installed/112/5). qiime tools view uses the registered system application to open the visualization index (e.g. index.html -\> web browser, index.pdf -\> pdf viewer, index.txt -\> text editor). Without a desktop environment, qiime has no way of handling the request to open the visualization (you don't have any applications to view it with!). I have opened up a bug report/feature [request here](https://github.com/qiime2/q2cli/issues/103) --- we will make sure that the failure notice is …

Let us know if that works for you! Thanks!

---

<div class="post-metadata">

**Author:** ![ErikaGanda](https://forum.qiime2.org/user_avatar/forum.qiime2.org/erikaganda/32/29_2.png) [@ErikaGanda](https://forum.qiime2.org/u/ErikaGanda)\
**Post date:** [February 6, 2017, 4:05pm UTC](https://forum.qiime2.org/t/error-in-qiime-feature-table-summarize/308/3 "2017-02-06T16:05:18Z")

</div>

Thank you, transferring it all to my mac worked!

This is funny though, because I was able to produce the quality plots with no problem on the headless server and just copied the artifact into my mac to visualize in [view.qiime2.org](http://view.qiime2.org)

Interesting that this time it wouldn't even produce the artifact...

Thanks so much for the quick response!

---

<div class="post-metadata">

**Author:** ![jairideout](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jairideout/32/9_2.png) [@jairideout](https://forum.qiime2.org/u/jairideout)\
**Post date:** [February 7, 2017, 2:07am UTC](https://forum.qiime2.org/t/error-in-qiime-feature-table-summarize/308/4 "2017-02-07T02:07:50Z")

</div>

> [@ErikaGanda](#):
>
> This is funny though, because I was able to produce the quality plots with no problem on the headless server and just copied the artifact into my mac to visualize in [view.qiime2.org](http://view.qiime2.org)
> 
> Interesting that this time it wouldn't even produce the artifact...

The quality score plots are generated using R, which seems to work out-of-the-box on a headless sever. `feature-table summarize` uses matplotlib (in Python) to generate the visualization. The solution @thermokarst posted instructs matplotlib to use a headless rendering backend (matplotlib's default backend usually requires a display).

Glad to hear it's working!

---

<div class="post-metadata">

**Author:** ![ErikaGanda](https://forum.qiime2.org/user_avatar/forum.qiime2.org/erikaganda/32/29_2.png) [@ErikaGanda](https://forum.qiime2.org/u/ErikaGanda)\
**Post date:** [February 9, 2017, 1:31pm UTC](https://forum.qiime2.org/t/error-in-qiime-feature-table-summarize/308/5 "2017-02-09T13:31:55Z")

</div>

Thanks for explaining it @jairideout!
