When I ran brew postinstall python3, it failed.
Error code:
$ brew postinstall python@3.9 --debug
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/python@3.9.rb
==> Postinstalling python@3.9
==> /usr/local/Cellar/python@3.9/3.9.1_8/bin/python3 -m ensurepip
Last 15 lines from /Users/wangdi/Library/Logs/Homebrew/python@3.9/post_install.01.python3:
2021-02-09 21:23:55 +0800
/usr/local/Cellar/python@3.9/3.9.1_8/bin/python3
-m
ensurepip
Warning: The post-install step did not complete successfully
You can try again using:
brew postinstall python@3.9
==> An exception occurred within a child process:
BuildError: Failed executing: /usr/local/Cellar/python@3.9/3.9.1_8/bin/python3 -m ensurepip
/usr/local/Homebrew/Library/Homebrew/formula.rb:2108:in `block in system'
/usr/local/Homebrew/Library/Homebrew/formula.rb:2044:in `open'
/usr/local/Homebrew/Library/Homebrew/formula.rb:2044:in `system'
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/python@3.9.rb:272:in `post_install'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1058:in `block (2 levels) in run_post_install'
/usr/local/Homebrew/Library/Homebrew/formula.rb:900:in `with_logging'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1057:in `block in run_post_install'
/usr/local/Homebrew/Library/Homebrew/utils.rb:532:in `with_env'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1046:in `run_post_install'
/usr/local/Homebrew/Library/Homebrew/postinstall.rb:22:in `<main>'
It said failed to run /usr/local/Cellar/python@3.9/3.9.1_8/bin/python3 -m ensurepip . I list the dir, but there is no /usr/local/Cellar/python@3.9/3.9.1_8/bin
$ ls /usr/local/Cellar/python@3.9/3.9.1_8
Frameworks
brew doctor result:
$ 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: Putting non-prefixed coreutils in your path can cause GMP builds to fail.
Warning: Putting non-prefixed findutils in your path can cause python builds to fail.