AuthenticMBC wrote:
I'm newbie in all this staff and it's quite difficult for me to figure out, how can I assign the correct permissions and ownership to Homebrew ?
You don't. You delete Homebrew. That's the only advice I can give. If you want actual support from Homebrew, you'll have to contact the Homebrew Help Desk. (Note: I'm just being sarcastic. There is no Homebrew Help Desk or any support of any kind. They release that junk to the world with the expectation that someone else is going to clean up the mess for them.)
What I'm asking you to do is create a new User account on your Mac. That new account will have a fresh set of dot files like ".zshrc" or whatever. Just copy all of those dot files from the new account to your current account. Note the current permissions on those files. You will need to do something like:
sudo chown AuthenticMBC:staff .zshrc
Depending on what your current files look like. Make it look like your current files. Your group might be "wheel" instead.
None of your Python code or anything is going to work in this kind of environment. It is only to fix whatever is broken. Then, you'll need to delete Homebrew. Then, you can properly install Python and whatever else you need.