X Tutup
Skip to content

Using matplotlib without Tkinter #7115

@TheChymera

Description

@TheChymera

I am using matplotlib on a headless server, so I don't have or want any GUI support.

Recently (since about 3 days ago, no what this update may have coincided with) I have become unable to import pyplot, due to matplotlib requiring Tkinter:

    import matplotlib.pyplot as plt
  File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 114, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "/usr/lib64/python2.7/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
    globals(),locals(),[backend_name],0)
  File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 6, in <module>
    from matplotlib.externals.six.moves import tkinter as Tk
  File "/usr/lib64/python2.7/site-packages/matplotlib/externals/six.py", line 199, in load_module
    mod = mod._resolve()
  File "/usr/lib64/python2.7/site-packages/matplotlib/externals/six.py", line 113, in _resolve
    return _import_module(self.mod)
  File "/usr/lib64/python2.7/site-packages/matplotlib/externals/six.py", line 80, in _import_module
    __import__(name)
ImportError: No module named Tkinter

I believe some other change in my system exposed this long hidden issue, and pyplot has always required Tkinter- is it possible to change that?


  • Matplotlib-1.5.3 Python-2.7.12 running on Gentoo Linux
  • Installed from source via Portage

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    X Tutup