LoginSignup
1
0

More than 5 years have passed since last update.

matplotlibのインストールでハマったメモ

Posted at

はじめに

CentOS7.4で、Python3の環境を整えようとしてハマったのでメモ。
日本語の記事がなかなか見つからなかったので、備忘録に。

環境

CentOS 7.4-1708
Python3.6

生じた問題

pip3 install matplotlib

を実行後、python3環境にて、

import matplotlib.pyplot as plt

を実行したが、以下のエラーを吐いた。

ModuleNotFoundError: No module named 'tkinter'

解決方法

tkinterなるものを入れれば良さそうだったので、下記のサイトに書いてある諸々を試した。
CentOS 7 python + matplotlibでエラーになった対策
しかしこれでは解決しなかったので、以下のサイトを参考にした。
【備忘録】CentOS6.7+Python2.7+matplotlibでハマった
Python2系の記事だが、問題は同じ感じで、以下を試して解決した。

yum install python36u-tkinter

これで、matplotlibやpython3の再インストールを行わずとも問題は解消したようだ。
今後これでもダメそうなら再インストールとか試すかも。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0