Last Updated January 22, 2018
Run these in order from the ~ (home) directory:
sudo apt-get install python3-dev
https://forum.xda-developers.com/showpost.php?p=73316166&postcount=1950
adb reboot booloader
fastboot oem unlock
cd
into the directory where the stock image was unzipped to first): ./flash-all.sh