[Python] How to fix " serial is not defined " in python

Discussão em 'Python' iniciado por Stack, Abril 13, 2025.

  1. Stack

    Stack Membro Participativo

    I'm currently using serial package for python and I have followed every tutorial on the internet but I have always got this error.

    NameError: name 'serial' is not defined

    I have already tried from serial import Serial and from serial import * . I have also uninstalled and re-installed the package. Thank you in advance.

    from serial import Serial

    sr = serial.Serial('COM4', 9600)

    Continue reading...

Compartilhe esta Página