CentOS Stream 9にMatplotlibをインストールする

環境
# cat /etc/redhat-release
CentOS Stream release 9

1.Pythonのバージョンを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# python -V
Python 3.9.10
# python -V Python 3.9.10
# python -V
Python 3.9.10

2.pipとsetuptoolsを更新します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# python -m pip install --upgrade pip setuptools
# python -m pip install --upgrade pip setuptools
# python -m pip install --upgrade pip setuptools

3.matplotlibのインストール
# pip install matplotlib

4.動作確認
ファイル名 12.py

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
import matplotlib
print(matplotlib.__version__)
import matplotlib print(matplotlib.__version__)
import matplotlib

print(matplotlib.__version__)

実行結果

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# python 12.py
3.5.1
# python 12.py 3.5.1
# python 12.py
3.5.1

 

CentOS Stream 9

Posted by arkgame