Skip to content

Instantly share code, notes, and snippets.

@skysan87
Created December 8, 2018 13:41
Show Gist options
  • Save skysan87/0f4d771a403c3276a3d4c4be00236483 to your computer and use it in GitHub Desktop.
Save skysan87/0f4d771a403c3276a3d4c4be00236483 to your computer and use it in GitHub Desktop.
Python v2->v3 アップデート

実行環境

  • macOS Mojave ver 10.14.1
  • Homebrew 1.8.4
  • Xcode 10.1(10B61)

1. バージョン確認

$ python -V
Python 2.7.10

2. Homebrewを最新にする

$ brew update

3. インストール

$ brew install python3

4. Error, Error, Error...

Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied @ dir_s_mkdir - /usr/local/Frameworks
Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks

5. Fix Error

$ sudo mkdir /usr/local/Frameworks
$ sudo chown $(whoami):admin /usr/local/Frameworks

$ brew reinstall python

# ???
$ python -V
Python 2.7.10

6. 結局

$ python3 -V
Python 3.7.1

参考

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