Skip to content

Instantly share code, notes, and snippets.

@LeeDDHH
Last active October 28, 2020 06:48
Show Gist options
  • Save LeeDDHH/5bd5e4039b4e75363ff440a3c11de428 to your computer and use it in GitHub Desktop.
Save LeeDDHH/5bd5e4039b4e75363ff440a3c11de428 to your computer and use it in GitHub Desktop.
macでバージョンアップが上手く聞かなかったときに試したこと

mac Mojaveでpyenvのバージョン切り替えができないときにやったこと

xcodeのコマンドラインツールを切り替える

  • xcodeインストール時に指定されるパス
    • /Applications/Xcode.app/Contents/Developer
  • コマンドラインから手動でxcode-selectをインストールしたときのパス
    • /Library/Developer/CommandLineTools
  • 切り替え
    • sudo xcode-select -switch [切り替えるパス]

Command Line Toolsを切り替える方法 | Sutepulu

xcode-selectを削除して再インストール

  • アンインストールのコマンドはないらしいので手動で削除
    • sudo rm -r /Library/Developer/CommandLineTools
  • インストール
    • xcode-select --install

ld: symbol(s) not found for architecture x86_64 エラーが発生

  • pyenvからインストール時に binutils が環境下にあると出るエラー
    • brew uninstall binutils

macOS で pyenv から python を導入する際 binutils が入ってるとコケる – ゴミ箱

Failed install on MacOS Mojave · Issue #1236 · pyenv/pyenv

zipimport.ZipImportError: can't decompress data; zlib not available エラー発生

  • macに zlib が入っていなかったため、インストール
    • brew install zlib
  • しかし、同じエラーが発生
  • どうやら、xcode-selectの最新版(2354)にMojave用のmacOS SDK headerがデフォルトで入っていないのが原因
    $ xcode-select -v
    xcode-select version 2354.
    
    # 手動でインストール
    $ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
  • これで pyenv からpythonのバージョンアップができるようになった

[MacOS Mojave]pyenvでpythonのインストールがzlibエラーで失敗した時の対応 - Qiita

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment