Skip to content

Latest commit

 

History

History
93 lines (61 loc) · 2.2 KB

installation_on_mac.md

File metadata and controls

93 lines (61 loc) · 2.2 KB
orphan
true

Installation on Mac

(terminal-app)=

Terminal.app

We'll be typing at the "terminal" prompt often during the class. In macOS, the program giving the terminal prompt is Terminal.app. It comes installed with macOS.

Press the Command key and the spacebar at the same time to open the Spotlight search box. (You can also click on the magnifier glass icon in menu bar towards the right). Type "terminal" and press return to open Terminal.app. You should get a terminal window. Consider pinning Terminal.app to your dock by right-clicking on the Terminal icon in the dock, chose "Options" and "Keep in dock".

Git

Git comes with the Apple macOS command line tools.

Install these by typing:

xcode-select --install

in Terminal.app. If you don't have the command line tools, you will get a dialog box like this:

Select "Install". You may need to wait a while for that to complete.

When it has run, check you can run the git command with this, in Terminal.app:

git

It should show you the Git help message.

Homebrew

Homebrew is "The missing package manager for macOS". It is a system for installing many open-source software packages on macOS. We recommend Homebrew to any serious Mac user; you will need it for the instructions on this page.

To install Homebrew, follow the instructions on the homebrew home page.

Python

Mac actually comes with a version of Python for its own use, but it's nearly always better to install your own version, for your use.

First, install with Homebrew.

In {ref}terminal-app, type:

brew install python

Next, open the file ~/.bash_profile with a text editor, for example, like this:

touch ~/.bash_profile
open -a TextEdit ~/.bash_profile

Scroll to the end of the file, and add this line:

export PATH=/usr/local/bin:$PATH

Be very careful that TextEdit doesn't capitalize Export for you. Correct it again to lower case if it does.

Save, and close the text editor. Close Terminal.app Start Terminal.app again, and confirm you are looking at the right Python:

which python3

You should see:

/usr/local/bin/python3