Amazonギフト券チャージでお得にお買い物

Macでpyenv install でエラーが出る場合の対処

2 min 9,402 views

pyenv install でpythonをインストールしようとしたら以下のエラーがでました。

satoshi@SatoshiMBP ~ % pyenv install 3.9.13
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.13.tar.xz...
-> https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tar.xz
Installing Python-3.9.13...
python-build: use tcl-tk from homebrew
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

BUILD FAILED (OS X 12.4 using python-build 20180424)

Inspect or clean up the working tree at /var/folders/wl/4rtz9lnx49346x27dy_s10b00000gn/T/python-build.20220603140711.27428
Results logged to /var/folders/wl/4rtz9lnx49346x27dy_s10b00000gn/T/python-build.20220603140711.27428.log

Last 10 log lines:
checking for python3.9... python3.9
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "darwin"
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/var/folders/wl/4rtz9lnx49346x27dy_s10b00000gn/T/python-build.20220603140711.27428/Python-3.9.13':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found.  Stop.

このへん

checking for —enable-universalsdk… no
checking for —with-universal-archs… no

が怪しそう。

Xcode を設定する

以下手順です。

  • Xcode-betaを開き、Prefarence->Locationsへ移動する
  • Command Line Tools を1でダウンロードしたバージョンに変更

pyenv で任意のPythonをインストールする
インストールできるバージョンを調べるには、
pyenv install –list
すると一覧が出てきます。

インストールできました。
同じような問題が出ている方はご参考になれば幸いです。

サトシ

サトシ

Macブロガー
幼少の頃からMac中心の生活。
MacやiPhoneなどApple関連とガジェットレビュー中心に情報発信します。
あなたの身近なところをサポート

カテゴリー:
関連記事