Installing Homebrew on Apple MacBook Air with M1 CPU

When I install Homebrew it gave me a warning that it (Homebrew) is not in my path.

Okay. I know Unix /Linux.


Which file do I add this new path PATH=/opt/homebrew/bin:$PATH


but to either edit ~/.zshrc or ~/.bashrc. Now as I said I am on a Mack Air with

an M1. It is understandable that a the Homebrew is not in my path. But I need to

which file ~/.zshrc or ~/.bashrc. is not enough. Specifically which file and where is it?


My knowledge pf Unix tells me it is a hidden file behind. the Desktop.


It says on the internet to use


export PATH=/opt/homebrew/bin:$PATH.


But doesn't that just make the additional path temporary. If I sign off and comeback in a month I would have to perform the again.


What command would put that in the correct hidden file and leave it there - permanently?


Any help appreciated. Thanks in advance.


Respectfully,


Led_Zepplin






Posted on Jan 4, 2021 12:18 PM

Reply

Similar questions

8 replies

Jan 4, 2021 12:50 PM in response to LedZepplin

I'm a bit rusty at this but I believe that you need

to use the "setenv" command (set environment).

I believe that that command makes it "sticky".


i.e. setenv PATH "/opt/homebrew/bin:$PATH"


Otherwise, I believe you need to create a ~/,zshenv

file and this should amend the current environment

variables since there is not a user accessible "rc" file

and the environment variables are loaded by the system

and set by system wide and user preferences and are a

pretty standard set of environment variables. Just do an

"env" and you'll see what defaults are loaded.

Jan 4, 2021 12:57 PM in response to LedZepplin

I tried the following commands to change the path and they did not work.


[/code]

login: Mon Jan  4 15:33:37 on ttys000


xxxx-xxxxxxr@Jamess-Air ~ % echo $PATH 


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


xxxxxxxxxxx@Jamess-Air ~ % homebrew                              


zsh: command not found: homebrew


xxxxxxxxxxx@Jamess-Air ~ % export PATH=/opt/homebrew/bin:$PATH   


xxxxxxxxxxx@Jamess-Air ~ % homebrew                              


zsh: command not found: homebrew


xxxxxxxxxxx@Jamess-Air ~ % echo $PATH                            


/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin


-Air ~ % homebrew


zsh: command not found: homebrew


xxxxxxxxxxx@Jamess-Air ~ % 

[code]


How do I get the Honebrew directory in my PATH?


Respectfully,


Led_Zepplin





Jan 4, 2021 6:52 PM in response to John Galt

Okay. I just started in the world. of Macs and Big Sur. I have a MacBook Air with an M1 CPU. I want to install jupyter notebook This is an IDE for machine learning that I have used for years on Linux, and Windows 10. I am intrigued by the M1's neural engine. I want speed and the M1 seems to deliver.

If I can find the link of the install procedure, I will post it in a future post.

To install jupyter notebook along the way I had to install homebrew. I installed it, but the install warned me that homebrew was not in my path. The homebrew install was successful, however. This happens with installing homebrew on an Apple Mac with the M1 CPU.


So now I must add a new path segment. If I write this


export PATH=/opt/homebrew/bin:$PATH


That should do it, but it is only temporary. If I sign off and come back in a week, then I must do it again. I remember from linux/Unix that to make it permanent one must put that command above at the .bashrc and then it will be permanent.


I cannot even find the .bashrc file in Big Sur. If I could and would add it straightaway.


I was confused when all the instructions I found on Google mentioned not one, but two files. So where do I put it?


You said in .bashrc and that sounds correct to me.


Can I use the command


echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.bashrc


?


Will this work? If so then I think my issue is resolved. Please. excuse such basic questions about the Mac and its OS. I have been using MACs only for one week.


Any help appreciated.


Respectfully,


Led_Zepplin


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Installing Homebrew on Apple MacBook Air with M1 CPU

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.