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

matplotlib raise RuntimeError ('Invalid DISPLAY variable') #22

Open
xingjianfeng100 opened this issue Sep 14, 2023 · 2 comments
Open

matplotlib raise RuntimeError ('Invalid DISPLAY variable') #22

xingjianfeng100 opened this issue Sep 14, 2023 · 2 comments

Comments

@xingjianfeng100
Copy link

xingjianfeng100 commented Sep 14, 2023

Hi, when plotting the kmer_freq, it reported errors like this:

"23-09-13 23:23:33 [INFO] Plot k15_q200_f2.kmer_freq.pdf
Traceback (most recent call last):
  File "~/.conda/envs/SubPhaser/bin/subphaser", line 33, in <module>
    sys.exit(load_entry_point('subphaser==1.2.6', 'console_scripts', 'subphaser')())
  File "~/.conda/envs/SubPhaser/lib/python3.8/site-packages/subphaser-1.2.6-py3.8.egg/subphaser/__main__.py", line 790, in main
    pipeline.run()
  File "~/.conda/envs/SubPhaser/lib/python3.8/site-packages/subphaser-1.2.6-py3.8.egg/subphaser/__main__.py", line 415, in run
    d_mat = dumps.filter(d_mat, lengths, self.sgs, outfig=histfig, #d_targets=d_targets, 
  File "~/.conda/envs/SubPhaser/lib/python3.8/site-packages/subphaser-1.2.6-py3.8.egg/subphaser/Jellyfish.py", line 504, in filter
    plot_histogram(tot_freqs, outfig, vline=None)
  File "~/.conda/envs/SubPhaser/lib/python3.8/site-packages/subphaser-1.2.6-py3.8.egg/subphaser/Jellyfish.py", line 647, in plot_histogram
    plt.figure(figsize=(7,5), dpi=300, tight_layout=True)
  File "~/.conda/envs/SubPhaser/lib/python3.8/site-packages/matplotlib/pyplot.py", line 797, in figure
    manager = new_figure_manager(
  File "~/.conda/envs/SubPhaser/lib/python3.8/site-packages/matplotlib/pyplot.py", line 316, in new_figure_manager
    return _backend_mod.new_figure_manager(*args, **kwargs)
  File "~/.conda/envs/SubPhaser/lib/python3.8/site-packages/matplotlib/backend_bases.py", line 3545, in new_figure_manager
    return cls.new_figure_manager_given_figure(num, fig)
  File "~/.conda/envs/SubPhaser/lib/python3.8/site-packages/matplotlib/backend_bases.py", line 3550, in new_figure_manager_given_figure
    canvas = cls.FigureCanvas(figure)
  File "~/.conda/envs/SubPhaser/lib/python3.8/site-packages/matplotlib/backends/backend_qt5agg.py", line 21, in __init__
    super().__init__(figure=figure)
  File "~/.conda/envs/SubPhaser/lib/python3.8/site-packages/matplotlib/backends/backend_qt5.py", line 213, in __init__
    _create_qApp()
  File "~/.conda/envs/SubPhaser/lib/python3.8/site-packages/matplotlib/backends/backend_qt5.py", line 108, in _create_qApp
    raise RuntimeError('Invalid DISPLAY variable')
RuntimeError: Invalid DISPLAY variable"

how can I solve it?

@zhangrengang
Copy link
Owner

It is an issue of interactive backend of matplotlib. Can you find and edit the file ~/.conda/envs/SubPhaser/lib/python3.8/site-packages/matplotlib/mpl-data/matplotlibrc , with setting backend : agg? agg is s a non-interactive backend.

@xingjianfeng100
Copy link
Author

It is an issue of interactive backend of matplotlib. Can you find and edit the file ~/.conda/envs/SubPhaser/lib/python3.8/site-packages/matplotlib/mpl-data/matplotlibrc , with setting backend : agg? agg is s a non-interactive backend.

I fixed it after running "bash script" instead of "sh script"; very nice tools, thanks for your response !

zhangrengang pushed a commit that referenced this issue Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants