Setting up development environment on macOS

Hi there,

I’ve been struggling over the last few days to get a development environment up and running on both my iMac and my Macbook.

Steps that are working for me:

  • [x] Create a fork of the home-assistant repo
  • [x] Clone out the fork locally and add upstream remote
  • [x] Create a branch on my own fork
  • [x] Create a venv to contain all the required packages

However, I cannot get the next step to work:

  • [ ] Run the script/setup script

After downloading all the requirements, pip3 tries to install them and that’s where it goes wrong in the following step: Running setup.py install for RPi.GPIO ... error. It fails while building this package with clang. This doesn’t seem completely strange to me as of course this is a very Raspberry Pi specific package.

Other (possibly) relevant info:
OS: macOS Sierra 10.12.4
Xcode Command Line Tools: 8.3.2.0.1.1492020469
Python version: 3.6.1 (installed via Homebrew)

What should I do to install the needed packages from requirements_all.txt under macOS?

Update:

It seems that the recent addition of some Raspberry PI specific components that require 'RPi.GPIO' causes this.

  • blinkt==0.1.0
  • envirophat==0.0.6

The following fails because a Mac has no I2C support

  • smbus-cffi==0.5.1

When I manually comment out these requirements in the requirements_all.txt, everything works as expected

Fixed with https://github.com/home-assistant/home-assistant/pull/7562

1 Like