user81402: I googled and couldn't find a solution to my nice problem:
I have Ubuntu and I want to program a ESP32 ...............
I tried a lot of pip commands ... but it didnt work.
You have any idea how to install the correct packages?
Maybe you can tell me what to do. I am really lost.
I tried it last year and also failed.. Now I want to try it another time :)
   /.arduino15/packages/esp32/tools/esptool_py/3.0.0/esptool.py", line 38, in <module>
        import serial
    ImportError: No module named serial


user69083: Open terminal and enter this command python -m pip install pyserial it will download pyserial for you and you will not receive the above error. The above error is because you don't have pyserial installed on the system.
The related documentation for pyserial could be found here

user81688: Problem resolved, Thank you.  I had installed pyserial.  The error surprisingly was related to the incorrect processor speed (!) in the Arduino IDE.  I have no idea why that would influence the serial/pyserial function.

user84475: I had the same issue compiling the CameraWebServer example. I'm using Ubuntu 20.04. The problem occurs during the linking stage when the script invokes python. On my system this runs the system python which is python 2.7.18. I don't think the serial module (supplied by pyserial) is available on Ubuntu 20.04 for python 2.x.
My solution was first to abandon the Arduino IDE and use the arduino-cli to compile the example. I created a virtual python 3 environment, activated it, installed pyserial under the virtual environment and run arduino-cli to make the runtime. The python scripts appear to be compatible with python 3.

81402: <p>I googled and couldn't find a solution to my nice problem:
I have Ubuntu and I want to program a ESP32 ...............
I tried a lot of pip commands ... but it didnt work.
You have any idea how to install the correct packages?
Maybe you can tell me what to do. I am really lost.
I tried it last year and also failed.. Now I want to try it another time :)</p>
<pre><code>   /.arduino15/packages/esp32/tools/esptool_py/3.0.0/esptool.py&quot;, line 38, in &lt;module&gt;
        import serial
    ImportError: No module named serial
</code></pre>
 69083: <p>Open terminal and enter this command <code>python -m pip install pyserial</code> it will download <code>pyserial</code> for you and you will not receive the above error. The above error is because you don't have <code>pyserial</code> installed on the system.</p>
<p>The related documentation for pyserial could be found <a href="https://pyserial.readthedocs.io/en/latest/pyserial.html" rel="nofollow noreferrer">here</a></p>
 81688: <p>Problem resolved, Thank you.  I had installed pyserial.  The error surprisingly was related to the incorrect processor speed (!) in the Arduino IDE.  I have no idea why that would influence the serial/pyserial function.</p>
 84475: <p>I had the same issue compiling the CameraWebServer example. I'm using Ubuntu 20.04. The problem occurs during the linking stage when the script invokes python. On my system this runs the system python which is python 2.7.18. I don't think the serial module (supplied by pyserial) is available on Ubuntu 20.04 for python 2.x.</p>
<p>My solution was first to abandon the Arduino IDE and use the arduino-cli to compile the example. I created a virtual python 3 environment, activated it, installed pyserial under the virtual environment and run arduino-cli to make the runtime. The python scripts appear to be compatible with python 3.</p>
