LoginSignup
0
0

More than 1 year has passed since last update.

RHELのAzureイメージにpython3をインストールする方法

Posted at

はじめに

この記事ではAzureRHEL7またはRHEL8イメージにpython3をインストールする方法を紹介します。

RHEL7

概要

RHEL7のAzureイメージでは、Pythonバージョン2.7.5がインストールされ、pythonコマンドはpython2を指しています。

python3RHEL 7.7からのみ利用可能であり、VMがRHEL 7.6以下などの以前のリリースを使用している場合、リポジトリからインストールできないことに注意してください。リポジトリからpython3をインストールするには、VMをRHEL 7.7にアップグレードしてください。

VMがRHEL 7.7以降であれば、次のコマンドを使用してpython3をインストールできます。

コマンド

sudo yum install python3 -y

結果

$ python --version
Python 2.7.5
$ python2 --version
Python 2.7.5
$ python3 --version
Python 3.6.8

RHEL8

概要

RHEL8のAzureイメージでは、Pythonバージョン3.6.8がインストールされ、pythonコマンドは設定されていません。pythonpython3を刺すようにするには次のコマンドを使ってください。

コマンド

sudo alternatives --set python /usr/bin/python3

結果

$ python --version
Python 3.6.8

おわりに

以上です。

0
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
0
0