LoginSignup
1
4

More than 5 years have passed since last update.

CentOS 7 に python 3.6.4 をインストールしてみる

Posted at

CentOS7にはデフォルトでpython2系のみがインストールされているので、python3系(現時点での最新版:3.6.4)をソースコードからインストールしてみます。
なお、同一環境内で複数のバージョンを使いたい場合はpyenvを活用する方がいいでしょう。

環境

  • CentOS 7.4.1708 (on VMware player)

インストール手順

1. ソースコードをダウンロード&解凍

ここではバージョン3.6.4をインストールします。

$ wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
$ tar zxf Python-3.6.4.tgz

2. コンパイル&インストール

ここでのインストール先は /usr/local 下にします。
指定しなければ、インストール先はシステム依存となります。
インストールはroot権限で行いますので、rootになるかsudoコマンドを使用しましょう。

$ cd Python-3.6.4
$ ./configure --prefix=/usr/local
$ make
# make install

これでpython3系のインストールは完了です!!

参考

1
4
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
4