Somehow permissions have been altered on brew and/or pip3 and both are getting errors.
brew has a lock file but when I remove it with sudo, brew commands say it iw still there. pip3 worked to install mat, but it told me I should update pip3. However, running the command it said to use gets a permissions error.
I would think that restoring from Time Machine would fix it, but I'm not quite sure what directories to restore. I don't want to 'restore' something else that was legitimately changed.
Update: brew gives a different message after reboot:
WGroleau@MBP ~ % brew update
/usr/local/Homebrew/Library/Homebrew/utils/lock.sh: line 29: /usr/local/var/homebrew/locks/update: Permission denied
Traceback (most recent call last):
2: from -e:1:in `<main>'
1: from -e:1:in `new'
-e:1:in `initialize': Bad file descriptor (Errno::EBADF)
Error: Another active Homebrew update process is already in progress.
Please wait for it to finish or terminate it to continue.
before, it was almost the same, but it also gave the path/name of a lock file, which I deleted, only to find a retry complained about the same file.
I did NOT run another home-brew process in parallel.
I examined the script mentioned above. Line 29 was not helpful, but a different part of the script had an error message about permissions and suggested
sudo chown -R \$(whoami):staff /usr/local/var/homebrew
which enabled brew to START running and do a lot, but then started complaining "no such file" in the "Cellar" and also mentioning symlinks. So I tried
sudo chown -R \$(whoami):staff /usr/local/Cellar /usr/local\Homebrew /usr/local\Frameworks
and that allowed brew upgrade
to run a lot further. But I still got "Error: Permission denied @ apply2files - /usr/local/share/locale/am/LC_MESSAGES/glib20.mo".
Perhaps brew
can only be run by the account that installed it … yes (sigh)