I am trying to upload a sketch to the ESP32-CAM board using Arduino IDE 1.8.12 and I get an error message:

exec: "python": executable file not found in $PATH
Error compiling for board AI Thinker ESP32-CAM.

My OS is Ubuntu 18.04.4.LTS.

When I type python in the console, it does open python:

$ python
Python 2.7.17 (default, Nov  7 2019, 10:07:09) 
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

Also python is in one of the directories referenced by PATH:

$ which python
$ echo $PATH

I added an additional URL referring to the ESP32 boards on the Espressif website:

Arduino IDE > File > Preferences > Settings > Additional Boards Manager URLs: > https://dl.espressif.com/dl/package_esp32_index.json

Then I added the libraries for all ESP32 boards:

Arduino IDE > Tools > Board > Boards Manager > esp32 version 1.0.4

(I tried with version 1.0.3 and it didn't change anything...)

I selected my board in the interface:

Arduino IDE > Tools > Board > AI Tinker ESP32-CAM

I granted all permissions to the USB port:

sudo chmod a+rwx /dev/ttyUSB0
ls -la /dev/ttyUSB0
crwxrwxrwx 1 root dialout 188, 0 Mar  4 21:25 /dev/ttyUSB0

My sketch is really simple:

void setup() {

void loop() {

I get the same error for any example sketch and for any ESP32 board.

Any idea how this could be fixed ?

2 Answers 2


All right so I was able to fix the problem. The Arduino IDE I was using had been installed from the Ubuntu Software Center. I uninstalled it.

Then I reinstalled the Arduino IDE by downloading it from the www.arduino.cc website and doing a manual install in /opt. Now it works awesome.

  • Good, that you solved the problem. You can mark your answer as correct, so that other can see, that this problem is solved.
    – chrisl
    Mar 6, 2020 at 8:10

This was an issue with the old Arduino IDE snap on Ubuntu. You can easily fix this by installing the new arduino snap:

snap install arduino

Then add your user to the dailout group:

sudo usermod -a -G dialout $USER

After this, reboot your device and open Arduino IDE.

Installing additional libraries

The Arduino IDE snap runs inside of a sandbox for security and stability reasons. This means it cannot access the Python libraries on your device. The snap bundles Python 3 and the serial library. If you need any other Python dependencies, you can install them inside of the sandbox using the arduino.pip command.

arduino.pip install <package-name>

Note: do not use sudo for this command

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.