AnacondaのパッケージMatplotlibをPython IDLEで使用したい。
Python IDLEでMatplotlibパッケージを使用したいのですが、Anacondaをインストールした後に、IDLEでMatplotlibをインポートしても以下のようなエラーが発生(numpyはインポート成功したのですが)してしまいます。ちなみにTerminalではきちんと機能します。
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import matplotlib.pyplot as plt
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/pyplot.py", line 29, in <module>
import matplotlib.colorbar
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/colorbar.py", line 36, in <module>
import matplotlib.contour as contour
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/contour.py", line 23, in <module>
import matplotlib.text as text
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/text.py", line 33, in <module>
from matplotlib.backend_bases import RendererBase
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/backend_bases.py", line 66, in <module>
import matplotlib.backend_tools as tools
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 674, in exec_module
File "<frozen importlib._bootstrap_external>", line 779, in get_code
File "<frozen importlib._bootstrap_external>", line 487, in _compile_bytecode
ValueError: bad marshal data (unknown type code)