PEP 719 にあるように、
PEP 719 – Python 3.13 Release Schedule
https://peps.python.org/pep-0719/
2025-02-05(日本時間) に Python 3.13.2 がリリースされました。
https://www.python.org/downloads/release/python-3132/
(以下、Google Chromeで翻訳)
ここから======
Python 3.13.2
発売日: 2025年2月4日
これはPython 3.13の2回目のメンテナンスリリースです。
Python 3.13 は Python プログラミング言語の最新のメジャー リリースであり、Python 3.12 と比較して多くの新機能と最適化が含まれています。3.13.2 は最新のメンテナンス リリースであり、3.13.1 以降、約 250 件のバグ修正、ビルドの改善、ドキュメントの変更が含まれています。
======ここまで
ソースはこの中の以下のものです。
https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tar.xz
早速、Raspberry Pi にソースをダウンロードしてみます。
$ wget https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tar.xz
--2025-02-04 23:55:35-- https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tar.xz
Resolving www.python.org (www.python.org)... 2a04:4e42:8c::223, 146.75.112.223
Connecting to www.python.org (www.python.org)|2a04:4e42:8c::223|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 22621108 (22M) [application/octet-stream]
Saving to: ‘Python-3.13.2.tar.xz’
Python-3.13.2.tar.x 100%[===================>] 21.57M 39.0MB/s in 0.6s
2025-02-04 23:55:35 (39.0 MB/s) - ‘Python-3.13.2.tar.xz’ saved [22621108/22621108]
$ wget https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tar.xz.asc
--2025-02-04 23:55:58-- https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tar.xz.asc
Resolving www.python.org (www.python.org)... 2a04:4e42:8c::223, 146.75.112.223
Connecting to www.python.org (www.python.org)|2a04:4e42:8c::223|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 963 [application/octet-stream]
Saving to: ‘Python-3.13.2.tar.xz.asc’
Python-3.13.2.tar.x 100%[===================>] 963 --.-KB/s in 0s
2025-02-04 23:55:58 (23.0 MB/s) - ‘Python-3.13.2.tar.xz.asc’ saved [963/963]
$
$ gpg --verify Python-3.13.2.tar.xz.asc
gpg: assuming signed data in 'Python-3.13.2.tar.xz'
gpg: Signature made Tue 04 Feb 2025 18:44:53 GMT
gpg: using RSA key 7169605F62C751356D054A26A821E680E5FA6305
gpg: Good signature from "Thomas Wouters <thomas@python.org>" [unknown]
gpg: aka "Thomas Wouters <thomas@xs4all.nl>" [unknown]
gpg: aka "Thomas Wouters <twouters@google.com>" [unknown]
gpg: aka "Thomas Wouters <thomas.wouters.prive@gmail.com>" [unknown]
gpg: aka "Thomas Wouters <thomaswout@gmail.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 7169 605F 62C7 5135 6D05 4A26 A821 E680 E5FA 6305
$
スケジュール通りですね。早速インストールしてみましょう。3.13.1 の時と同じようにしてみます。
$ tar xvf ......../Python-3.13.2.tar.xz
$ cd Python-3.13.2
$
$ ./configure --prefix=/usr/local/python --with-readline --enable-shared --enable-optimizations
例によって、Raspberry Piでは時間がかかるので time コマンドで計測します。
$ time make
.............
The necessary bits to build these optional modules were not found:
_dbm
To find the necessary bits, look in configure.ac and config.log.
Checked 112 modules (33 built-in, 77 shared, 1 n/a on linux-aarch64, 0 disabled, 1 missing, 0 failed on import)
make[1]: Leaving directory '......................espiya/src/Python-3.13.2'
real 51m6.586s
user 48m55.436s
sys 1m31.861s
$
やはり、50分以上かかりますね。
$ su
# make install
Python3 を使うための環境変数設定は、ここでは python3.sh にしてあるので、
$ source python3.sh
$ which
/usr/local/python/bin/python3
$
$ python3
Python 3.13.2 (main, Feb 5 2025, 00:55:10) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
今後は、 Python 3.13.2 を使う事にします。
さて、Python3で for 文とか入れると、
>>> for i in range(3):
... print(i)
...
0
1
2
>>>
のようになりますが、プロンプト >>> で、上矢印キーを押すと
>>> for i in range(3):
... print(i)
のようにいっぺんに出てくるのは、3.13 の特徴です。これは、readline や ncurses を使っていると思われます。
別のところで同様なインストールをしたとき、readline と ncurses でエラーがでてしまいました。
これは、readline と ncurses も事前にソースからインストールしておいて、Python 3.13 をビルドすると途中でエラーになるような現象でした。
そのときは make 時に、readline と ncurses のモジュールがないというメッセージがでていました。
記録していたわけではないのでうろ覚えですが、これにはまると中々抜け出せそうもないので、そんなときはおとなしくシステムのものを使う事をお勧めします。
PEP 719 – Python 3.13 Release Schedule
https://peps.python.org/pep-0719/
2025-02-05(日本時間) に Python 3.13.2 がリリースされました。
https://www.python.org/downloads/release/python-3132/
(以下、Google Chromeで翻訳)
ここから======
Python 3.13.2
発売日: 2025年2月4日
これはPython 3.13の2回目のメンテナンスリリースです。
Python 3.13 は Python プログラミング言語の最新のメジャー リリースであり、Python 3.12 と比較して多くの新機能と最適化が含まれています。3.13.2 は最新のメンテナンス リリースであり、3.13.1 以降、約 250 件のバグ修正、ビルドの改善、ドキュメントの変更が含まれています。
======ここまで
ソースはこの中の以下のものです。
https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tar.xz
早速、Raspberry Pi にソースをダウンロードしてみます。
$ wget https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tar.xz
--2025-02-04 23:55:35-- https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tar.xz
Resolving www.python.org (www.python.org)... 2a04:4e42:8c::223, 146.75.112.223
Connecting to www.python.org (www.python.org)|2a04:4e42:8c::223|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 22621108 (22M) [application/octet-stream]
Saving to: ‘Python-3.13.2.tar.xz’
Python-3.13.2.tar.x 100%[===================>] 21.57M 39.0MB/s in 0.6s
2025-02-04 23:55:35 (39.0 MB/s) - ‘Python-3.13.2.tar.xz’ saved [22621108/22621108]
$ wget https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tar.xz.asc
--2025-02-04 23:55:58-- https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tar.xz.asc
Resolving www.python.org (www.python.org)... 2a04:4e42:8c::223, 146.75.112.223
Connecting to www.python.org (www.python.org)|2a04:4e42:8c::223|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 963 [application/octet-stream]
Saving to: ‘Python-3.13.2.tar.xz.asc’
Python-3.13.2.tar.x 100%[===================>] 963 --.-KB/s in 0s
2025-02-04 23:55:58 (23.0 MB/s) - ‘Python-3.13.2.tar.xz.asc’ saved [963/963]
$
$ gpg --verify Python-3.13.2.tar.xz.asc
gpg: assuming signed data in 'Python-3.13.2.tar.xz'
gpg: Signature made Tue 04 Feb 2025 18:44:53 GMT
gpg: using RSA key 7169605F62C751356D054A26A821E680E5FA6305
gpg: Good signature from "Thomas Wouters <thomas@python.org>" [unknown]
gpg: aka "Thomas Wouters <thomas@xs4all.nl>" [unknown]
gpg: aka "Thomas Wouters <twouters@google.com>" [unknown]
gpg: aka "Thomas Wouters <thomas.wouters.prive@gmail.com>" [unknown]
gpg: aka "Thomas Wouters <thomaswout@gmail.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 7169 605F 62C7 5135 6D05 4A26 A821 E680 E5FA 6305
$
スケジュール通りですね。早速インストールしてみましょう。3.13.1 の時と同じようにしてみます。
$ tar xvf ......../Python-3.13.2.tar.xz
$ cd Python-3.13.2
$
$ ./configure --prefix=/usr/local/python --with-readline --enable-shared --enable-optimizations
例によって、Raspberry Piでは時間がかかるので time コマンドで計測します。
$ time make
.............
The necessary bits to build these optional modules were not found:
_dbm
To find the necessary bits, look in configure.ac and config.log.
Checked 112 modules (33 built-in, 77 shared, 1 n/a on linux-aarch64, 0 disabled, 1 missing, 0 failed on import)
make[1]: Leaving directory '......................espiya/src/Python-3.13.2'
real 51m6.586s
user 48m55.436s
sys 1m31.861s
$
やはり、50分以上かかりますね。
$ su
# make install
Python3 を使うための環境変数設定は、ここでは python3.sh にしてあるので、
$ source python3.sh
$ which
/usr/local/python/bin/python3
$
$ python3
Python 3.13.2 (main, Feb 5 2025, 00:55:10) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
今後は、 Python 3.13.2 を使う事にします。
さて、Python3で for 文とか入れると、
>>> for i in range(3):
... print(i)
...
0
1
2
>>>
のようになりますが、プロンプト >>> で、上矢印キーを押すと
>>> for i in range(3):
... print(i)
のようにいっぺんに出てくるのは、3.13 の特徴です。これは、readline や ncurses を使っていると思われます。
別のところで同様なインストールをしたとき、readline と ncurses でエラーがでてしまいました。
これは、readline と ncurses も事前にソースからインストールしておいて、Python 3.13 をビルドすると途中でエラーになるような現象でした。
そのときは make 時に、readline と ncurses のモジュールがないというメッセージがでていました。
記録していたわけではないのでうろ覚えですが、これにはまると中々抜け出せそうもないので、そんなときはおとなしくシステムのものを使う事をお勧めします。