user16459: 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.
>>> 
KeyboardInterrupt
>>> 

Also python is in one of the directories referenced by PATH:
$ which python
/usr/bin/python
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

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 ? 

user16459: 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.

user66360: 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

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

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

<p>My OS is Ubuntu 18.04.4.LTS. </p>

<p>When I type python in the console, it does open python:</p>

<pre><code>$ 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.
&gt;&gt;&gt; 
KeyboardInterrupt
&gt;&gt;&gt; 
</code></pre>

<p>Also python is in one of the directories referenced by PATH:</p>

<pre><code>$ which python
/usr/bin/python
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
</code></pre>

<p>I added an additional URL referring to the ESP32 boards on the Espressif website:</p>

<pre><code>Arduino IDE &gt; File &gt; Preferences &gt; Settings &gt; Additional Boards Manager URLs: &gt; https://dl.espressif.com/dl/package_esp32_index.json
</code></pre>

<p>Then I added the libraries for all ESP32 boards:</p>

<pre><code>Arduino IDE &gt; Tools &gt; Board &gt; Boards Manager &gt; esp32 version 1.0.4
</code></pre>

<p>(I tried with version 1.0.3 and it didn't change anything...)</p>

<p>I selected my board in the interface:</p>

<pre><code>Arduino IDE &gt; Tools &gt; Board &gt; AI Tinker ESP32-CAM
</code></pre>

<p>I granted all permissions to the USB port:</p>

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

<p>My sketch is really simple:</p>

<pre><code>void setup() {
}

void loop() {
}
</code></pre>

<p>I get the same error for any example sketch and for any ESP32 board.</p>

<p>Any idea how this could be fixed ? </p>
 16459: <p>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.</p>

<p>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.</p>
 66360: <p>This was an issue with the old Arduino IDE snap on Ubuntu. You can easily fix this by installing the new <a href="https://snapcraft.io/arduino" rel="nofollow noreferrer">arduino snap</a>:</p>

<pre><code>snap install arduino
</code></pre>

<p>Then add your user to the <code>dailout</code> group:</p>

<pre><code>sudo usermod -a -G dialout $USER
</code></pre>

<p>After this, <strong>reboot your device</strong> and open Arduino IDE.</p>

<h2>Installing additional libraries</h2>

<p>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 <code>serial</code> library. If you need any other Python dependencies, you can install them inside of the sandbox using the <code>arduino.pip</code> command.</p>

<pre><code>arduino.pip install &lt;package-name&gt;
</code></pre>

<p><em>Note: do not use <code>sudo</code> for this command</em></p>
