0
0

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 3 years have passed since last update.

mac python 環境構築時のエラー

Last updated at Posted at 2021-01-17

macにpython環境を構築する際に発生したエラーの対処方法が調べても出てきにくかったのでまとめました.

pythonのインストール時に以下のコマンドをターミナルに入力しました.

$ pyenv install 3.9.1

すると,以下のようなエラーが出てきました.

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/9y/b18s20496nz6mc47pmf2czdm0000gn/T/python-build.20210117143950.2739/Python-3.9.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

gcc(XcodeのCommand Line Tools)をインストールすると解決しました.

1.Xcodeを開き,左上(りんごマーク横)の
Xcodeタブ>Open Developer Tool>More Developer Tools...

2.Xcodeのapple IDでログイン

3.Command Line Tools for Xcode 12.0.dmg(任意のバージョン)をダウンロード

4.インストール

5.インストールの確認

gcc -dumpversion   
12.0.0

以上の操作をしたところ,エラーがなくなりpythonをインストールできました.

pyenv install 3.9.1
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.1.tar.xz...
-> https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tar.xz
Installing Python-3.9.1...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
Installed Python-3.9.1 to /Users/shogo/.pyenv/versions/3.9.1

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?