Pythonの開発環境の準備

Xcode、Homebrewをインストール
参考:MacにHomebrewを導入する方法

brew doctorを実行してエラー確認
2つエラーが出た。

1.Pythonとのリンクでエラー

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  python

書いてある通り brew link python を実行したけど、これまたエラー。
/usr/local/Frameworksのディレクトリがあるか確認し、なければmkdrしたうえで、権限を与える。
参考:Homebrewで入れたPythonでのlinkエラー問題

2.xcode-selectがインストールされていなかった

Warning: Xcode alone is not sufficient on Mojave.
Install the Command Line Tools:
  xcode-select –install

これもそのまま xcode-select –install を実行してインストール。