I wanted to start coding Spencer using Circruitblocks on Mac running macOS Big Sur, but everytime I pressed “run”, after a while I got “Compile error. Check your code then try again” message. It was happening even if my blocks were completely empty so there was unlikely anything wrong with the code.
After a bit of digging around with CircuitBlocks dev environment I found it’s related to this esptools.py issue
I managed to solve this by following these steps https://github.com/pyserial/pyserial/issues/509#issuecomment-726966076.
One difference was that the esptool file that’s supposed to be replaced wasn’t at ~/Library/Arduino15/packages/esp32/tools/esptool_py/2.6.1/ but instead ~/Library/Arduino15/packages/cm/tools/esptool_py/2.6.1/, so you might need to look around for it.
After this I ran into “No module named serial” issue. For some reason
pip3 install pyserial didn’t help, so I needed to manually download and install pyserial:
Download a release from here https://github.com/pyserial/pyserial/releases
and install it by running
python setup.py install (might require
sudo) in the downloaded and extracted release folder.
Now my code gets compiled and uploaded to Spencer,
hope this helps anyone running into the same problem.