2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

CentOS7.9(2009)に対してPython3.11のインストール手順メモ

Last updated at Posted at 2022-11-28

CentOS7.9(2009)に対してPython3.11のインストール手順メモ

概要

OS

  • ディストリビューション:CentOS 7.9 2009
  • インストールオプション:Minimalインストール

Python3.11

  • OpenSSL1.1.1以降が必要。
  • CentOS7系はtclが含まれていないことから、tcl関連を考慮した上で、ビルドする必要がある。

コマンド

全体

$ sudo yum -y install wget perl perl-Test-Simple perl-Test-Harness libffi-devel gcc zlib-devel bzip2 bzip2-devel readline readline-devel sqlite sqlite-devel tcl tcl-devel
$ sudo yum -y groupinstall "Development Tools"

Pythonのため既存OpenSSLへのケア

$ sudo yum list installed | grep openssl
$ sudo yum -y remove openssl.x86_64
$ sudo yum list installed | grep openssl

OpenSSL1.1.1sインストール

$ wget --no-check-certificate https://www.openssl.org/source/openssl-1.1.1s.tar.gz
$ tar xzf openssl-1.1.1s.tar.gz
$ cd openssl-1.1.1s
$ ./config
$ make
$ make test
$ sudo make install
$ sudo ldconfig -p | grep libssl.so.1.1s
$ ldd /usr/local/bin/openssl
$ sudo sh -c 'echo /usr/local/lib64 > /etc/ld.so.conf.d/local.conf'
$ sudo ldconfig
$ sudo ldconfig -p | grep libssl.so.1.1s
$ /usr/local/bin/openssl version
$ sudo ln -s /usr/local/bin/openssl /usr/bin/openssl
$ openssl version

Python3.11インストール

  • configureした際にオプション--enable-optimizationsを求められますが、オプション付けると失敗しました。
  • make testで失敗や処理スキップが出ていますが、動いてはいます。結果は備考欄に記載ます。
$ wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz
$ tar -xzf Python-3.11.0.tgz
$ cd Python-3.11.0
$ ./configure
$ make
$ make test
$ sudo make install
$ sudo ln -s /usr/local/bin/python3.11 /usr/bin/python3
$ sudo ln -s /usr/local/bin/pip3.11 /usr/bin/pip3
$ python3 --version
$ pip3 --version

備考

  • Python3.11 make test結果
Ran 1 test in 12.028s

FAILED (failures=1)
test test_unicodedata failed
1 test failed again:
    test_unicodedata

== Tests result: FAILURE then FAILURE ==

416 tests OK.

1 test failed:
    test_unicodedata

19 tests skipped:
    test_devpoll test_gdb test_idle test_ioctl test_kqueue
    test_launcher test_msilib test_ossaudiodev test_startfile test_tcl
    test_tix test_tk test_ttk_guionly test_ttk_textonly test_turtle
    test_winconsoleio test_winreg test_winsound test_zipfile64

1 re-run test:
    test_unicodedata

Total duration: 13 min 17 sec
Tests result: FAILURE then FAILURE
make: *** [test] エラー 2
2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?