简体   繁体   中英

Installation of GDAL on MacOS Catalina is failing

I'm trying to install GDAL on my mac (Catalina 10.15.7) using brew:

brew install gdal

but I'm running into an error that I don't understand:

==> 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

I've also tried the following:

brew install --build-from-source gdal 

But I run into the exact same error. I don't really understand what's the problem, though it seems to be related to permissions.

I need some help on what I should do to resolve it.

The following command:

  sudo chown -R $USER /usr/local

and a reinstall, solved the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM