[ Foro de Python ]

Error: module 'serial' has no attribute 'Serial'

04-Aug-2020 21:53
Jonathan Romero
0 Respuestas

Tengo este pequeño código:

import serial
import time

puertoSerie = serial.Serial('COM7', 9600, timeout=1)
time.sleep(2)

line = puertoSerie.readline()

while True:
   time.sleep(2)
   print(line)
   puertoSerie


con esta salida:
Traceback (most recent call last):
 File "serial2.py", line 4, in <module>
   puertoSerie = serial.Serial('COM7', 9600, timeout=1)
AttributeError: module 'serial' has no attribute 'Serial'

El problema ocurre en esta linea:
" AttributeError: module 'serial' has no attribute 'Serial' "

ya intente de muchas maneras, desinstalando pyserial con pip y reinstalando,
agregando:
from serial import Serial
y no jala.

Estoy en windows...

En manjaro me correo pero no me lee bién el serial.
Alguna sugerencia?
De ante mano, gracias.




(No se puede continuar esta discusión porque tiene más de dos meses de antigüedad. Si tienes dudas parecidas, abre un nuevo hilo.)