Install Homebrew For Mac



Mac OS X comes with Python 2.7 out of the box.

Dec 09, 2019 One last thing before Homebrew is fully installed on your Mac, you will be prompted to enter your administrator password in order to proceed. So when prompted, enter the password to begin the installation. Lastly, simply give it anywhere from 2-5 minutes depending on your Mac’s specs as well as your internet connection speeds. Jun 19, 2019 Install Homebrew on macOS Launch the terminal (/Applications/Utilities/Terminal) application on your system and then run below command on it ruby -e '$(curl -fsSL The installation process will prompt for the password. See full list on treehouse.github.io.

You do not need to install or configure anything else to use Python 2. Theseinstructions document the installation of Python 3.

The version of Python that ships with OS X is great for learning, but it’s notgood for development. The version shipped with OS X may be out of date from theofficial current Python release,which is considered the stable production version.

Doing it Right¶

Let’s install a real version of Python.

Before installing Python, you’ll need to install GCC. GCC can be obtainedby downloading Xcode, the smallerCommand Line Tools (must have anApple account) or the even smaller OSX-GCC-Installerpackage.

Note

If you already have Xcode installed, do not install OSX-GCC-Installer.In combination, the software can cause issues that are difficult todiagnose.

Note

If you perform a fresh install of Xcode, you will also need to add thecommandline tools by running xcode-select--install on the terminal.

While OS X comes with a large number of Unix utilities, those familiar withLinux systems will notice one key component missing: a package manager.Homebrew fills this void.

To install Homebrew, open Terminal oryour favorite OS X terminal emulator and run

The script will explain what changes it will make and prompt you before theinstallation begins.Once you’ve installed Homebrew, insert the Homebrew directory at the topof your PATH environment variable. You can do this by adding the followingline at the bottom of your ~/.profile file

If you have OS X 10.12 (Sierra) or older use this line instead

Now, we can install Python 3:

This will take a minute or two.

Pip¶

Homebrew installs pip pointing to the Homebrew’d Python 3 for you.

Working with Python 3¶

At this point, you have the system Python 2.7 available, potentially theHomebrew version of Python 2 installed, and the Homebrewversion of Python 3 as well.

will launch the Homebrew-installed Python 3 interpreter.

will launch the Homebrew-installed Python 2 interpreter (if any).

will launch the Homebrew-installed Python 3 interpreter.

If the Homebrew version of Python 2 is installed then pip2 will point to Python 2.If the Homebrew version of Python 3 is installed then pip will point to Python 3.

The rest of the guide will assume that python references Python 3.

Pipenv & Virtual Environments¶

The next step is to install Pipenv, so you can install dependencies and manage virtual environments.

A Virtual Environment is a tool to keep the dependencies required by different projectsin separate places, by creating virtual Python environments for them. It solves the“Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keepsyour global site-packages directory clean and manageable.

For example, you can work on a project which requires Django 1.10 while alsomaintaining a project which requires Django 1.8.

So, onward! To the Pipenv & Virtual Environments docs!

This page is a remixed version of another guide,which is available under the same license.

Homebrew is a developer’s heartthrob.

If you have never heard of it then it’s basically just a package manager that makes it super easy to install different kinds of software and tools onto your Mac. Say if you’re looking to install Git, Ruby or NodeJS or a Unix command-line utility, then simply just by entering one line of code you can install the software on the get-go.

It also helps to avoid issues that relate to using the sudo command when installing certain software.

Now whether you are a technical demigod or a newbie who just learned how to type “Hello World” for the first time, this guide is written in such a way it guides you step-by-step on how to install Homebrew on Mac.

If you have any questions or if you do not understand what a certain command does, feel free to Google it or comment down below and one of us or our amazing readers will help you. 🙂

So without further ado, let’s first discuss what you’ll be needing.

What you will need

  • A Mac running at least Mac OS X 10.10 or later.
  • Have Command Line Tools installed. You may refer to this Stack Overflow thread for the guide until we write up an updated guide on this in the coming weeks.
  • It’s recommended to have some knowledge of using the Mac Command Line and using both bash and zsh. Regardless, we will still show you step-by-step on how to install Homebrew.

Once you have the above ‘stuff’, then you’re ready to proceed with the installation which is shown below. Before that, we like to give our thanks for the guys over at brew.sh for making this Homebrew installation possible for all of us Mac users. 🙂

Let’s jump right in.

How to Install Homebrew on Mac

  1. Grab your Macbook Pro, Macbook Air or Macbook or hop onto your iMac or Mac Pro and then simply open the Terminal application (as shown below).
Help! I can’t find the Terminal application on my Mac?

The Terminal application can also be located using the Finder on your Mac and then referring to the following path /Applications/Utilities/. Alternatively, you can also just type “Terminal” into Spotlight Search.

  1. Sweet. Next, copy-paste the following command into your Terminal:

/usr/bin/ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'

  1. Then hit the Enterkey.
  2. You will find that there will be a few lines where it will provide instructions and explain what Homebrew does and what the script will install as well as where those installs will be located, etc. Simply just hit the Enter or Return key to agree. You can quit by pressing the Escape key.
  3. One last thing before Homebrew is fully installed on your Mac, you will be prompted to enter your administrator password in order to proceed. So when prompted, enter the password to begin the installation.
  4. Lastly, simply give it anywhere from 2-5 minutes depending on your Mac’s specs as well as your internet connection speeds. When it is complete you should see the message “Installation successful!”.

That’s all there is to it!

How To Install Packages With Homebrew For OS X

Now you can go ahead and install packages via the Homebrew. You may refer to the Commands Guide below to grasp the various commands used in Homebrew.

Helpful Commands Guide

The help command will help if you want to figure out what a certain command does or learn any other parts of Homebrew which you may have not known.

Download homebrew mac

The command is entered as follows:

brew help

The command to install any packages such as Docker, MongoDB or just about any software or tool that you find then use the install [enter-package-name-here] command. The command is entered as follows:

Install Homebrew Mac Without Admin

brew install [enter-package-name-here]

For example, if you wish to install Docker using Homebrew onto your Mac, the command is written as follows:

brew install docker

What about keeping Homebrew updated? Good question and an important one too! There is a command for that too and yes you guessed it, update. It is important that you keep your Homebrew updated frequently as suggested by the original developers of Homebrew themselves. There are frequent updates released for it so be sure to check for it always. Simply enter the command as written below whenever you want to check if there are any updates waiting for the Homebrew to be completed:

brew update

Whilst you’re at it, you may also want to learn how to turn off Homebrew’s analytics tracking. Turning it off can benefit your machine by reducing the network traffic as well as protect your privacy. The command is entered as follows:

brew analytics off

Wait, I Change My Mind. How Do I Remove Homebrew From My Mac?

If you installed Homebrew onto your Mac but you had a change of heart then you can uninstall. Simply copy-paste the following command into your Terminal and then hit the Enter key:

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

This will download and run the uninstaller script which will proceed to uninstall Homebrew from your Mac.

We hope that this guide has helped you install Homebrew on your Mac. If you have questions, please feel free to leave a comment below and we will love to help you out. ❤

If this guide helped you, please share it. 🙂