安装 python3失败No such file or directory @ dir_chdir - /usr/local/Cellar

==> Installing dependencies for python: gdbm, openssl, readline, sqlite and xz
==> Installing python dependency: gdbm
==> Downloading https://homebrew.bintray.com/bottles/gdbm-1.18.1.mojave.bottle.1
Already downloaded: /Users/xxx/Library/Caches/Homebrew/downloads/440b98240182d9fb5393666ca9f5411d864e84cbe189634ead14754dc3dd3712--gdbm-1.18.1.mojave.bottle.1.tar.gz
Error: No such file or directory @ dir_chdir - /usr/local/Cellar
Warning: Bottle installation failed: building from source.
==> Downloading https://ftp.gnu.org/gnu/gdbm/gdbm-1.18.1.tar.gz
Already downloaded: /Users/xxx/Library/Caches/Homebrew/downloads/c6e5196e3cea2a139cb849d508032f117c6351da5fe84323dc13ad2a0600264a--gdbm-1.18.1.tar.gz
Error: An exception occurred within a child process:
  Errno::EPERM: Operation not permitted @ dir_s_mkdir - /usr/local/Cellar

安装失败,提示没有这样的文件或者目录

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
重新安装 HomeBrew
brew install python3
安装 python3成功

你可能感兴趣的:(安装 python3失败No such file or directory @ dir_chdir - /usr/local/Cellar)