Chris90
Chris90

Reputation: 1998

Command Brew not Found?

I installed homebrew with ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" on Mac but when I try to install python3 with

brew install python3 

I get error of

zsh: command not found: brew

I know brew is installed but maybe I haven't done it in right location? I am in a directory of a folder in my desktop

Output of echo $PATH | tr ':' '\n'

/usr/local/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

Thanks for the help in advance

Upvotes: 0

Views: 3877

Answers (3)

Pilote101
Pilote101

Reputation: 1

I use the MacBook Air M1 and I have the same issue, where I need to run eval $(/opt/homebrew/bin/brew shellenv) every time I open the terminal to use brew.

I reran the 2 commands we are supposed to run after installing homebrew. (You need to replace [username] by your Mac user name)

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/[username]/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

I even completely rebooted my Mac to make sure the fix was permanent.

Upvotes: 0

A J
A J

Reputation: 4632

If using Macbook M1 chip run this after installation done

eval $(/opt/homebrew/bin/brew shellenv)

Upvotes: 0

Prince Vishwa
Prince Vishwa

Reputation: 11

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/neerajvishwa/.zprofile

type this in terminal - it worked for me

Upvotes: 1

Related Questions