首页 > 解决方案 > 在 MacOS Catalina 上安装 GDAL 失败

问题描述

我正在尝试使用 brew 在我的 mac(Catalina 10.15.7)上安装 GDAL:

brew install gdal

但我遇到了一个我不明白的错误:

==> Pouring glib-2.66.4.catalina.bottle.tar.gz
cp: utimes: /usr/local/Cellar/glib/.: Operation not permitted
cp: chmod: /usr/local/Cellar/glib/.: Operation not permitted
Error: Failure while executing; `cp -pR /var/folders/7f/r7941wjd1fj2zlm79hwzlkcc0000gn/T/d20201223-26491-1643kjj/glib/. /usr/local/Cellar/glib` exited with 1. Here's the output:
cp: utimes: /usr/local/Cellar/glib/.: Operation not permitted
cp: chmod: /usr/local/Cellar/glib/.: Operation not permitted

Warning: Bottle installation failed: building from source.
==> Patching
Error: An exception occurred within a child process:
  Errno::ENOENT: No such file or directory @ rb_sysopen - /Users/<my_username>/Library/Caches/Homebrew/downloads/54f3f612bdfc9bfc09633176c7673816fe2a2188e470bf48d60d826bdf6bf21a--hardcoded-paths.diff

我还尝试了以下方法:

brew install --build-from-source gdal 

但我遇到了完全相同的错误。我真的不明白问题出在哪里,尽管它似乎与权限有关。

我需要一些帮助来解决它。

标签: pythondjangomacosgdalmacos-catalina

解决方案


以下命令:

  sudo chown -R $USER /usr/local

并重新安装,解决了问题。


推荐阅读