Beginners Guide: Setting A Python Environment on M
  • Introduction
  • Update it, right away!
  • Download, download
  • Python
  • Option 1: Brew it!
    • Using Home-brew
    • Python with Homebrew
  • Option 2: Pyenv it!
    • Install and use multiple Python versions
  • Option 3: Conda it!
  • Run Python
    • Get pip!
    • NumPy-SciPy-Matplotlib
    • Get an IDE
Powered by GitBook
On this page
  1. Option 1: Brew it!

Python with Homebrew

PreviousUsing Home-brewNextOption 2: Pyenv it!

Last updated 7 years ago

To install Python 2.7 plus any dependencies required (it can take a few minutes to build everything) just run the following in your terminal window (always without the $, your default terminal window will always start with the following username$ ):

$ brew install python

When finished, you should see a summary in the terminal.

Plus running this line: $ which python should output : /usr/local/bin/python.

It also installs (and its dependency ), which is the package manager for Python.

Finally, let's get them upgraded. Run both the lines:

$ pip install --upgrade setuptools
$ pip install --upgrade pip

Executable scripts from Python packages you install will be put in /usr/local/share/python, we already had this in the Env.sh file created before. Save the file and open a new terminal to take the new $PATH into account (everytime you open a terminal, .bash_profile gets loaded).

pip
Setuptools