OS:ubuntu14.04 LTS
pyenv virtualenv 3.5.2 xxx to build python3 environment
afterwards,
pip install matplotlib
Install matplotlib with: No problem so far.
Dohama from here. In a dialogue environment
>>>import matplotlib.pyplot
When you do
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/.pyenv/versions/pyenv3.5.2/lib/python3.5/site-packages/matplotlib/pyplot.py", line 115, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/home/user/.pyenv/versions/pyenv3.5.2/lib/python3.5/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "/home/user/.pyenv/versions/pyenv3.5.2/lib/python3.5/site-packages/matplotlib/backends/backend_tkagg.py", line 6, in <module>
from six.moves import tkinter as Tk
File "/home/user/.pyenv/versions/pyenv3.5.2/lib/python3.5/site-packages/six.py", line 92, in __get__
result = self._resolve()
File "/home/user/.pyenv/versions/pyenv3.5.2/lib/python3.5/site-packages/six.py", line 115, in _resolve
return _import_module(self.mod)
File "/home/user/.pyenv/versions/pyenv3.5.2/lib/python3.5/site-packages/six.py", line 82, in _import_module
__import__(name)
File "/home/user/.pyenv/versions/3.5.2/lib/python3.5/tkinter/__init__.py", line 35, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named '_tkinter'
I get an error like this and can't take a step forward.
I searched various sites and rewritten the backend
of matplotlibrc
,
I tried putting in freetype
and libpng
, but it didn't work at all.
Change the version of matplotlib.
If you check with pip freeze
etc. and it is matplotlib == 2.0.0
,
(xxx)pip uninstall matplotlib
(xxx)pip install matplotlib==1.4.3 * xxx is the virtualenv environment name
Try installing the previous version with.
In my case, this succeeded in ʻimport of
matplotlib.pyplot`.
Reference: matplotlib.pyplot stopped working well with version 1.5.0 @Mac
Recommended Posts