Struggling with what should be a basic homebrew install for python

Viewed 2123

I have been trying to install some Python packages using terminal on mac and have fallen at the first hurdle when trying to install homebrew. When I attempt to install it I get the following message that I don't know how to resolve.

==> Downloading and installing Homebrew...
remote: Enumerating objects: 782, done.
remote: Counting objects: 100% (782/782), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 1337 (delta 774), reused 774 (delta 767), pack-reused 555
Receiving objects: 100% (1337/1337), 473.03 KiB | 520.00 KiB/s, done.
Resolving deltas: 100% (974/974), completed with 341 local objects.
From https://github.com/Homebrew/brew
   f7a718c1f..d2430bcf5  master     -> origin/master
 * [new tag]             2.7.6      -> 2.7.6
 * [new tag]             2.7.7      -> 2.7.7
HEAD is now at d2430bcf5 Merge pull request #10473 from dtrodrigues/man-force
error: Not a valid ref: refs/remotes/origin/master
fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Any help or pointers would be greatly appreciated.

1 Answers

You need to first uninstall homebrew and then install it again.

For uninstalling Homebrew in MacOS Catalina, macOS Big Sur, and MacOS Mojave:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"

For uninstalling Homebrew from MacOS High Sierra, Sierra, El Capitan, and earlier:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Related