"How to pass PATH" to learn with homebrew

What you can learn from this article

If you are currently visiting this article

-bash: xxxx: command not found

I think you've hit the error. And until now when such an error came out "Error-> Search-> Copy-> I'm not sure but solved" Isn't it like that? (I used to be ...)

From that state by looking at this article "Error-> Search-> Copy-> __Understanding __-> Resolve" or You can be in the state of "Error-> __ Think __-> Resolve". In other words, does PATH pass like this! You will understand that!

Learn from examples

Let's learn how to PATH from my example.

What kind of error occurred

I bought a MacBook Air today and wanted to install homebrew, so I was installing while looking at this site. Then on a screen like this

Warning: /opt/homebrew/bin is not in your PATH.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.

Something is warning, but it's successful and is it okay! I thought, and when I execute the following command

MacBook-Air:~ username$ brew install
-bash: brew: command not found

Oh, there's no brew ...

What is PATH?

PATH is also known as an environment variable. Yes, it's a variable! Speaking of variables in programming, they are used like "__ Let's replace the same thing with a certain word because it is troublesome to write it many times __". Similarly, omit PATH because it's a hassle to write the same thing over and over again! It exists like __.

Now, in order to run brew you need to know where brew is. When I searched for the above error, it was in /opt/homebrew/bin/.

MacBook-Air:bin username$ /opt/homebrew/bin/brew -v

I tried this and it worked!

How to check PATH

I thought that the reason why brew -v couldn't be executed was apparently because the variables weren't set properly. After checking various things, it seems that the variables can be checked with the following code.

$echo $PATH

When I ran it, I got a lot of PATH.

-bash: /usr/local/bin:/usr/bin:/bin:/usr/sbin:・ ・ ・

This means

How to add PATH

I referred to this article.

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

By inputting like this, you can give an instruction to add/opt/homebrew/bin/to the environment variable "__ $ __"!

References

https://qiita.com/zaburo/items/29fe23c1ceb6056109fd https://qiita.com/Naggi-Goishi/items/2c49ea50602ea80bf015

Recommended Posts

"How to pass PATH" to learn with homebrew
How to Learn Kaldi with the JUST Corpus
How to pass the path to the library built with pyenv and virtualenv in PyCharm
How to update with SQLAlchemy?
How to cast with Theano
How to Alter with SQLAlchemy?
How to separate strings with','
How to RDP with Fedora31
How to learn structured SVM of ChainCRF with PyStruct
[How to!] Learn and play Super Mario with Tensorflow !!
How to Delete with SQLAlchemy?
(Note) How to pass the path of your own module
How to install Theano on Mac OS X with homebrew
How to cancel RT with tweepy
Python: How to use async with
How to use virtualenv with PowerShell
How to deal with imbalanced data
How to install python-pip with ubuntu20.04LTS
How to deal with imbalanced data
How to get started with Scrapy
How to get started with Python
How to use homebrew on Debian
How to deal with DistributionNotFound errors
How to get started with Django
How to Data Augmentation with PyTorch
How to use FTP with Python
How to calculate date with python
How to install mysql-connector with pip3
How to INNER JOIN with SQLAlchemy
How to install Anaconda with pyenv
How to authenticate with Django Part 2
How to authenticate with Django Part 3
[Hugo] Summary of how to add pages to sites built with Learn
How to pass VScode + WSL + Python Path (Unable to import ~ "xxx" solution)
How to pass arguments using an instance with systemd's systemctl command
How to do arithmetic with Django template
[Blender] How to set shape_key with script
How to title multiple figures with matplotlib
How to get parent id with sqlalchemy
How to add a package with PyCharm
How to install DLIB with 2020 / CUDA enabled
How to use ManyToManyField with Django's Admin
How to use Cmder with PyCharm (Windows)
How to prevent package updates with apt
How to work with BigQuery in Python
How to use Ass / Alembic with HtoA
How to deal with enum compatibility errors
How to use Japanese with NLTK plot
How to do portmanteau test with python
How to search Google Drive with Google Colaboratory
How to display python Japanese with lolipop
How to download youtube videos with youtube-dl
[Python / Tkinter] How to pass arguments to command
How to power off Linux with Ultra96-V2
How to scrape websites created with SPA
How to use CUT command (with sample)
How to enter Japanese with Python curses
[Python] How to deal with module errors
How to install zsh (with .zshrc customization)
How to read problem data with paiza
How to use SQLAlchemy / Connect with aiomysql