LoginSignup
11
5

More than 1 year has passed since last update.

【随時更新予定】macOS 12.2 Monterey上のpyenvで環境構築可能なPythonのバージョンの備忘録

Posted at

筆者のMacはmacOS 12.2 Montereyがインストールされています。pyenvと言えばPythonのバージョン管理アプリケーションであり、数年前から筆者も愛用しています。Montereyはリリースされて間も無いためか、pyenvで環境構築出来るバージョンと、ビルドエラーが発生してしまうバージョンが有ります。環境構築時にビルドエラーで詰まってしまうと困るため、備忘録メモとしてまとめておこうと思います。

2022年1月現在の状況

macOS 12.2 Monterey上のpyenvでpyenv install x.x.xを実行して環境構築出来たバージョンは以下の通りです。但し、dev版やcondaシリーズ等のバージョンは試しておらず、素のPythonのみです。

環境構築可能なバージョン

  • 3.10.2
  • 3.10.1
  • 3.10.0
  • 3.9.10
  • 3.9.9
  • 3.9.8

3.9.7以前のバージョンを環境構築しようとした場合

以下の様にエラー終了1します。

$ pyenv install 3.9.7
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.7.tar.xz...
-> https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tar.xz
Installing Python-3.9.7...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

BUILD FAILED (OS X 12.2 using python-build 2.2.4)

Inspect or clean up the working tree at /var/folders/7c/6xh3jhtj0pg15z13c49kmych0000gn/T/python-build.20220129135718.47549
Results logged to /var/folders/7c/6xh3jhtj0pg15z13c49kmych0000gn/T/python-build.20220129135718.47549.log

Last 10 log lines:
checking for a sed that does not truncate output... /usr/local/opt/gnu-sed/libexec/gnubin/sed
checking for --with-cxx-main=<compiler>... no
checking for clang++... no
configure:

  By default, distutils will build C++ extension modules with "clang++".
  If this is not intended, then set CXX on the configure command line.

checking for the platform triplet based on compiler characteristics... darwin
configure: error: internal configure error for the platform triplet, please file a bug report

まとめ

pyenvを用いてmacOS Monterey上に環境構築するときのための備忘録をまとめました。Montereyは昨年12月にリリースされたばかりのため、まだまだ各種アプリケーションの更新が追い付いていない様に思います。Pythonは利用者が多いので、今後更新が進んでいくのではと思います。


  1. clang++がnoになていますが、実際にはclang++やgccはインストール済の環境です。 

11
5
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
11
5