te-touのブログ

音楽制作・車・プログラミング・旅行・その他考えてる事など、備忘録的なことも含めて個人的なページです。

brew install python3したら、「Error: An unexpected error occurred during the `brew link` step」その1




久々にmacでpythonいじろうと思って、brewのバージョンどうなってるか見ようと思ってコマンド打ったらバージョン情報が出てきませんでした。
消えた?

よくわからないので、もう一度brew installすることにしました。

% brew install python3

インストールは進みましたが、ここで掲題の「期待されないエラー」が発生。

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

ディレクトリ作る許可がないと?

doctorとかいうコマンドで調査できるという情報があったので試行することに。

 % brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

気にすんな。と?

そんなこと言いながら、後続でバキバキにワーニング出ました。

Warning: Your Command Line Tools are too outdated.
Update them from Software Update in System Preferences or run:
  softwareupdate --all --install --force

If that doesn't show you any updates, run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

Alternatively, manually download them from:
  https://developer.apple.com/download/all/.
You should download the Command Line Tools for Xcode 13.0.


Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
  softwareupdate --all --install --force

If that doesn't show you any updates, run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

Alternatively, manually download them from:
  https://developer.apple.com/download/all/.
You should download the Command Line Tools for Xcode 13.0.


Warning: The following directories do not exist:
/usr/local/Frameworks
/usr/local/sbin

You should create these directories and change their ownership to your user.
  sudo mkdir -p /usr/local/Frameworks /usr/local/sbin
  sudo chown -R $(whoami) /usr/local/Frameworks /usr/local/sbin

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

Warning: Broken symlinks were found. Remove them with `brew cleanup`:
  /usr/local/bin/apm
  /usr/local/bin/atom
  /usr/local/share/man/man1/brew-cask.1
  /usr/local/share/zsh/site-functions/_brew_cask

気になりますわ。

そもそも、コマンドラインツールが古いとかから言われてます。
なので、壊れないことを祈りつつ上から処理していきます。

とかやってたら、「macOS Monterey」のアップグレードの通知がきました。
悩みどころ・・・ですが、一旦OSをアップグレードしてから上記対応しようかなと思いました。

ふと思ったら、OSをアップデートするたびに「Xcode」が消されている気がします。
上記のワーニングもXcodeが消されたせいで出てきたのでは???

なんか色々中途半端な状態でアップデートとか、いじり壊しそうで怖いです。が、やってみます。

↓つづき
www.te-tou.tokyo






www.youtube.com
www.facebook.com