I am compiling using MacBook air 2020 M1 chip
Big Sur 11.5.2
When compiling the ESP-32 CAM example CameraWebServer I get the following Error:
File "/Users/frankgriffin/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/tools/gen_esp32part.py", line 536
print(e, file=sys.stderr)
^
SyntaxError: invalid syntax
strong text
It might be caused by the wrong version of Python being used. print was changed to a function in Python 3 and that gen_esp32part.py was written for Python 3. You'll get exactly this error by trying to execute that script using Python 2.
The ESP32 boards platform expects that you will have Python 3 installed and in your path so it will run via the python command.
What do you get if you run this command from a terminal?:
Unfortunately, I don't know much about macOS. You will need to make sure the location of the Python 3 installation comes first in your PATH environment variable, before the Python 2 path. I'm sure there is a very user friendly way to do that, but I'm not sure what it is.
I see this:
You could go into that file and make sure to add the path of the Python 3 installation above the Python 2 one in the file.
The line that generates the error is in a Python script that is part of the ESP32 boards platform's toolchain: https://github.com/espressif/arduino-esp32/blob/1.0.6/tools/gen_esp32part.py#L536
but now that I look at the code, this is not actually the line that contains the problematic code. This is in a try ... except block and is only printing the exception that was raised somewhere else in the code.
Unfortunately, that "somewhere else" is the main() function, meaning the entire script!
Do you still get the error after you use the Arduino IDE's Boards Manager (Tools > Board > Boards Manager) to update to 2.0.0? Even if there is a reason you are using 1.0.6, it's worth doing just as an experiment. You can always install 1.0.6 again after.