In that case I’ll focus on making sure you have Open-CV installed in a location that Python can access it. Type and enter the following into your terminal.
sudo apt-get install python-opencv python3-opencv opencv-data
Also when you’re running the | headshots_picam.py | make sure you have run it using the terminal. Check out the bottom of the Training the System section of the written article for how to do this.