Homebrew does not like my attempts to update sqlite3

Trying to update the cli version of sqlite3 via homebrew

brew reinstall sqlite

but the procedure baulks with this error

Error: Permission denied @ apply2files - /opt/homebrew/lib/python3.11/site-packages/__pycache__/OleFileIO_PL.cpython-311.pyc

Clearly I have no idea what I have done wrong or what is needed to fix this problem. Every other homebrew install/reinstall/update/upgrade works as expected. It is only sqlite3 that does not.

It looks like your user may not have permission to tho the /opt/homebrew/lib/python3.11/site-packages/__pycache__ folder. You might want to ensure you can read and write to that directory.

Here’s a Stackoverflow discussion you might find helpful.

But make sure if you run this you’re pointing the change owner modification at /opt/homebrew not /usr/local

1 Like

Thank you @jacobio and @dustinknopoff both for your help and advice.

Haven’t used Stackoverflow much. Clearly a useful resource. One for me to check in future.

be careful, verify the date of the answers you get. A lot of no longer viable stuff is still there and can catch you if you do not check. I used to use it a lot but over time it’s become more and more unreliable with old now incorrect answers getting upvoted just because of age and the moderation is IMO draconian if you try to ask a similar question specifically requesting newer data and tools. Yours gets flagged and everyone points you to the old answer that won’t work due to version changes.

1 Like

Indeed know that only too well from using ChatGPT to bootstrap some perl, sed, awk code. For example, there was no indication from ChatGPT of what version of sed its generated examples were using; macOS has BSD’s version by default but the generated code expected GNU’s version.

I took a more defensive line.

ls -l /opt/homebrew/*| grep -v glimfeather|less

and then changed ownership of only the obviously “wrong” files.

3 Likes

brew doctor might have also helped here but I forget what that command does

It’s a repair facility.