Psy-Fer / SquiggleKit

SquiggleKit: A toolkit for manipulating nanopore signal data
MIT License
120 stars 23 forks source link

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

Open vetmohit89 opened 1 year ago

vetmohit89 commented 1 year ago

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 commented 1 year ago

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