LoginSignup
0
0

More than 1 year has passed since last update.

Ubuntuに最新バージョンのPythonをインストールする

Last updated at Posted at 2021-10-10

ubuntu20.04に最新のPython3.10.0をインストールする

###Ubuntuのバージョン確認。
cat /etc/lsb-release

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"

###アーキテクチャは64bit。
arch
x86_64

###ビルド環境の準備
sudo apt update
sudo apt install build-essential libbz2-dev libdb-dev
libreadline-dev libffi-dev libgdbm-dev liblzma-dev
libncursesw5-dev libsqlite3-dev libssl-dev
zlib1g-dev uuid-dev tk-dev

###ソースコードのダウンロード
Python Japanのダウンロードページ
https://pythonlinks.python.jp/ja/index.html

###ダウンロードコマンド
wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz

###解凍コマンド
tar xJf Python-3.10.0.tar.xz

###ビルドコマンド
cd Python-3.10.0
./configure
make
sudo make install

###再起動
reboot

###バージョン確認コマンド
python3 -V
Python 3.10.0

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