Python “No module named serial”: install pyserial, not serial

Install pyserial, not serial. The package is named pyserial but imported as serial.

What the message means

A different package called serial exists and breaks the import. Also, pip may install for a different Python than the one you run.

Fix it in this order

  1. Uninstall the package named serial if it is installed.
  2. Install pyserial with pip for the same Python you run.
  3. Use python -m pip to be sure the versions match.
  4. Check the import with a one-line test.
  5. Use a virtual environment for each project.
  6. Check the port name and permission afterwards.

Why it happens

The module imported as serial is provided by the package pyserial. Installing a package named serial gives a different library that does not work. The error also appears when pip installed the package for a different Python from the one running your script.

Run pip uninstall serial, then pip install pyserial, and use the same interpreter for both, for example python -m pip install pyserial.

If you see this, do this

You seeDo this
Module not foundPackage missing for this Python.
Has no attribute SerialWrong serial package.

serial permission, Serial Monitor blank.

Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.