Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone
Description
Bug report
I just wanted to use matplotlib to draw a line graph and save it to a file, but every time I try to import the pyplot module I get the abovementioned error message.
python3 -c "import matplotlib.pyplot"
Actual outcome
>>> import matplotlib.pyplotTraceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.6/site-packages/matplotlib/pyplot.py", line 115, in <module> _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File "/usr/local/lib/python3.6/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup globals(),locals(),[backend_name],0) File "/usr/local/lib/python3.6/site-packages/matplotlib/backends/backend_tkagg.py", line 6, in <module> from six.moves import tkinter as Tk File "/usr/local/lib/python3.6/site-packages/six.py", line 92, in __get__ result = self._resolve() File "/usr/local/lib/python3.6/site-packages/six.py", line 115, in _resolve return _import_module(self.mod) File "/usr/local/lib/python3.6/site-packages/six.py", line 82, in _import_module __import__(name) File "/usr/local/lib/python3.6/tkinter/__init__.py", line 36, in <module> import _tkinter # If this fails your Python may not be configured for TkModuleNotFoundError: No module named '_tkinter'
Expected outcome
Whatever happens whenimport matplotlib.pyplot
succeeds
Matplotlib version
- Operating System: Windows Subsystem for Linux
- Matplotlib Version: 2.0.2
- Python Version: 3.6.0
I installed matplotlib using pip.
Doingsudo apt-get install python3-tk
, as recommended by someone on Stack Overflow, didn't help.