Skip to content

Instantly share code, notes, and snippets.

@devlights
Created June 19, 2018 05:17
Show Gist options
  • Save devlights/7151abe65759395605bd306067a944ca to your computer and use it in GitHub Desktop.
Save devlights/7151abe65759395605bd306067a944ca to your computer and use it in GitHub Desktop.
[python] ソースからビルドするやり方 (ubuntu linux)

環境を最新に

$ sudo apt -y update
$ sudo apt -y upgrade

ビルドに必要なパッケージをインストール

$ sudo apt -y install build-essential
$ sudo apt -y install python3-dev
$ sudo apt -y install libsqlite3-dev
$ sudo apt -y install libreadline6-dev
$ sudo apt -y install libgdbm-dev
$ sudo apt -y install zlib1g-dev
$ sudo apt -y install libbz2-dev
$ sudo apt -y install sqlite3
$ sudo apt -y install tk-dev
$ sudo apt -y install zip
$ sudo apt -y install libssl-dev

python本体をビルド

$ tar xf Python-X.X.X.tgz
$ cd PythonX.X.X
$ ./configure --prefix=/opt/PythonX.X.X
$ make
$ sudo make install

シンボリックリンクを貼る

$ sudo ln -s /opt/PythonX.X.X/bin/pythonX.X /usr/local/bin/pythonX.X
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment