0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

UbuntuのPythonバージョン切り替え方法

0
Last updated at Posted at 2025-09-21

はじめに

個人的なメモとしてPythonのバージョン切り替え方法を書きました。
Ubbuntuの環境は以下になります。

  • WSL2
  • Ubuntu 20.04

Pythonのリポジトリ登録

リポジトリ登録のために、software-properties-commonをインストール

$ sudo apt update
$ sudo apt install software-properties-common

リポジトリ登録

$ sudo add-apt-repository ppa:deadsnakes/ppa

Pythonインストール

3.13をインストール

$ sudo apt install python3.13

インストールされたPythonのバージョン確認

$ which python3.13

インストールされたPythonの動作確認

$ python3.13 --version

Pythonのバージョン切り替え

alternativesでPythonのバージョンを切り替える

$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.13 1

切り替えたPythonのバージョン確認

$ python --version

参考

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?