I am bringing up a new R-Pi Zero W that will interface to some servo motors using PivotPi. I started with a new raspbian stretch img and went through PivotPi installation. After starting the system with the PivotPi and motors attached, I made the basic test:
import pivotpi
pp = pivotpi.PivotPi()
This error occurred: RuntimeError: Could not determine default I2C bus for platform.
The stack trace included this line:
File “/usr/local/lib/python3.5/dist-packages/Adafruit-0.0.0-py3.5.egg/I2C.py”, line 65, in get_i2c_device
I cracked Adafruit-0.0.0-py3.5.egg open and learned that it includes Platform.py that is outdated. It does not identify a BCM2835 chip as a valid chip to run on. It should!
Out of curiousity I looked inside pivotpi-0.0.0-py3.5.egg and found that it has an updated version of Platform.py that allows for BCM2835, and this code should be used instead of the one in the Adafruit egg. The pivotpi egg contained a superset of the files in the Adafruit egg, so it seemed like it could replace the Adafruit egg.
I renamed Adafruit-0.0.0-py3.5.egg to Adafruit-0.0.0-py3.5.egg.rotten to prevent Python3 from loading it. Presumably the pivotpi egg would be used instead.
When I repeated my test, the error was corrected and now I can use the pivotpi controller.
I believe that if a customer tries to use a Pi Zero W with a BCM2835 chip, they will have the problem I had. My workaround, getting rid of Adafruit-0.0.0-py3.5.egg, should be made permanent.