最近のMacのアップデートでpython3.9.1になったため、pipenvの依存関係が壊れてpython3.8系に変更したいと思い、pyenvを使用して3.8.6をダウンロードしようとしたところ以下のようなエラーが出ました。
zsh
1% pyenv install 3.8.6 2 3python-build: use openssl@1.1 from homebrew 4python-build: use readline from homebrew 5Downloading Python-3.8.6.tar.xz... 6-> https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tar.xz 7Installing Python-3.8.6... 8python-build: use readline from homebrew 9python-build: use zlib from xcode sdk 10 11BUILD FAILED (OS X 11.1 using python-build 20180424) 12 13Inspect or clean up the working tree at /var/folders/fx/nv5nlm1d4hl_ft_s9v7by75h0000gn/T/python-build.20201222185807.2067 14Results logged to /var/folders/fx/nv5nlm1d4hl_ft_s9v7by75h0000gn/T/python-build.20201222185807.2067.log 15 16Last 10 log lines: 17checking for python3... python3 18checking for --enable-universalsdk... no 19checking for --with-universal-archs... no 20checking MACHDEP... "darwin" 21checking for gcc... clang 22checking whether the C compiler works... no 23configure: error: in `/var/folders/fx/nv5nlm1d4hl_ft_s9v7by75h0000gn/T/python-build.20201222185807.2067/Python-3.8.6': 24configure: error: C compiler cannot create executables 25See `config.log' for more details 26make: *** No targets specified and no makefile found. Stop.
pyenvでインストールが可能なversionを調べたのですが、そこにはしっかり乗っており問題はありませんでした。
zsh
1pyenv install --list 2 3Available versions: 4以上略 5 3.6.8 6 3.6.9 7 3.6.10 8 3.6.11 9 3.6.12 10 3.7.0 11 3.7-dev 12 3.7.1 13 3.7.2 14 3.7.3 15 3.7.4 16 3.7.5 17 3.7.6 18 3.7.7 19 3.7.8 20 3.7.9 21 3.8.0 22 3.8-dev 23 3.8.1 24 3.8.2 25 3.8.3 26 3.8.4 27 3.8.5 28 3.8.6 29 3.9.0 30 3.9-dev 31 3.10-dev 32以下略
目標としてはpipenvで3.8.6系が使えるようになることです。そのためその他の方法でも参考になる情報があれば教えていただきたいです。
今までは「pyenv install」は正常に実行出来ていましたか?
Command Line Tools はどうなってるでしょう。
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
の結果のversionとかどうでしょう。
pyenv は今まで入っておらず、使ったことはありません。pipenv installは正常に動いていました。
pkgutil --pkg-info=com.apple.pkg.CLTools_Executablesをそのままいれたところ、
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
と出力されました。
brew --config で確認した結果、
CLT: 1103.0.32.62
となりました。
> configure: error: C compiler cannot create executables
上記エラーが出ているので
gcc -v
で問題ないか確認してはどうでしょうか?
※問題ない場合はpyenvの再インストールで治った例もあるようです。https://cocoinit23.com/pyenv-configure-error-c-compiler-cannot-create-executables/
gcc -vの結果以下のようになりました。エラーは吐いてないので正常と思います。
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin20.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
pyenv再インストールしましたがダメでした...
解決しました。
Command Line Toolsが変だったみたいです。下のサイトを参考にインストールし直したらいけました。
https://qiita.com/baby-0105/items/18f6fbc073e160bf83ac
回答1件
あなたの回答
tips
プレビュー