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

ImportError: Cannot load backend 'TkAgg' which requires the 'tk' interactive framework, as 'headless' is currently running #62

Open
vetmohit89 opened this issue Dec 29, 2022 · 1 comment

Comments

@vetmohit89
Copy link

I am trying to run segmenter with the following command
python segmenter.py -s data.tsv -ku -j 100 > signals_stall_segments.tsv

It is giving following error.

Traceback (most recent call last):
File "segmenter.py", line 4, in
import matplotlib.pyplot as plt
File "/home/mbansal/.conda/envs/mlpy/lib/python3.6/site-packages/matplotlib/pyplot.py", line 2336, in
switch_backend(rcParams["backend"])
File "/home/mbansal/.conda/envs/mlpy/lib/python3.6/site-packages/matplotlib/pyplot.py", line 287, in switch_backend
newbackend, required_framework, current_framework))
ImportError: Cannot load backend 'TkAgg' which requires the 'tk' interactive framework, as 'headless' is currently running

@Psy-Fer
Copy link
Owner

Psy-Fer commented Jan 1, 2023

Hello,
This is probably because you don't have tkinter installed.

You can either try installing that, or try these 2 solutions.

  1. comment out line 3 in segmenter.py
    #matplotlib.use('TkAgg')
  2. change line 3 in segmenter.py to
    matplotlib.use('Agg')

I hope this helps

James

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