title: What's the problem with serial connection in the following code (running on Raspberry Pi 4, Raspbian OS)?
body: <p>this serial connection thing on RPi should not be this challenging, though right now I'm facing something quite weird</p>
  
  <p><strong>This is the code:</strong></p>
  
  <pre><code>   .
     .
     import serial
     .
     .
     ser=serial.Serial(
         port='/dev/ttyUSB0',
         baudrate=115200,
         parity=serial.PARITY_NONE,
         stopbits=serial.STOPBITS_ONE,
         bytesize=serial.EIGHTBITS,
         timeout=1
     )
     .
     .
  </code></pre>
  
  <p><strong>The Error is:</strong></p>
  
  <pre><code>Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 265, in open
      self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
  FileNotFoundError: [Errno 2] No such file or directory: '/dev/ttyUSB0'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/home/pi/Desktop/rtu-v4/dnp3/rtu.py", line 27, in &lt;module&gt;
      timeout=1
    File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 240, in __init__
      self.open()
    File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 268, in open
      raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
  serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'
  </code></pre>
  
  <p><strong>I alraedy checked out:</strong></p>
  
  <p><a href="https://www.raspberrypi.org/forums/viewtopic.php?t=224369" rel="nofollow noreferrer">https://www.raspberrypi.org/forums/viewtopic.php?t=224369</a></p>
  
  <p><a href="https://github.com/brendan-w/python-OBD/issues/137" rel="nofollow noreferrer">https://github.com/brendan-w/python-OBD/issues/137</a></p>
  
  <p><strong>and ran the following commands in terminal:</strong>
  <code>sudo pip3 uninstall serial</code>
  <code>sudo pip3 install pyserial</code></p>
  
  <p><strong>The Device is a Raspberry Pi 4</strong></p>
  
  <p>Any Help would be appreciated.
  Thnx.</p>