Python Forum
pyserial/serial "has no attribute 'Serial' "
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pyserial/serial "has no attribute 'Serial' "
#1
Hi there ! glad to discover this forum.

first, i am a beginner, i want to learn Python etc.

i was typing this program :

import serial 
serial_port = serial.Serial(port = "COM3", baudrate = 9600)
serial_port.readline()
and i get this error code :

Error:
File "c:\Users\Mérill\Desktop\pytharduino2\ardseri.py3", line 2, in <module> serial_port = serial.Serial(port = "COM3", baudrate = 9600) ^^^^^^^^^^^^^ AttributeError: module 'serial' has no attribute 'Serial'
i tried to reinstall the pyserial library, uninstall the serial library,

i tried the method
from serial import Serial


it does not help. i have an other error code

Error:
File "c:\Users\Mérill\Desktop\pytharduino2\ardseri.py3", line 1, in <module> from serial import Serial ^^^^^^^^^^^^^^^^^^^^^^^^^ ImportError: cannot import name 'Serial' from 'serial' (unknown location)
so i tried a lot of different common solutions to fix this problem. But i am stuck Sad

i am using Python3.x
Reply


Messages In This Thread
pyserial/serial "has no attribute 'Serial' " - by gowb0w - Aug-23-2023, 05:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Writing to two different serial ports independent of each other Aggie64 6 1,708 Dec-11-2024, 10:51 PM
Last Post: deanhystad
  sending strings to arduino over serial/accessing DLLs HeWhoHas 0 887 Nov-09-2024, 06:01 PM
Last Post: HeWhoHas
  PC why serial code = converting to ascii ? trix 11 2,859 Oct-12-2024, 11:10 PM
Last Post: deanhystad
  PyQt5 - issue of delay in overall performance & user interface while using serial COM thiru 0 960 Jun-18-2024, 08:34 AM
Last Post: thiru
  Waiting for input from serial port, then move on KenHorse 3 4,445 Apr-17-2024, 07:21 AM
Last Post: DeaD_EyE
  MCU reboots after opening Serial port when ran from Raspberry PI zazas321 3 1,880 Mar-19-2024, 09:02 AM
Last Post: zazas321
  importing serial Fklein23 2 4,273 Jul-05-2023, 01:32 PM
Last Post: deanhystad
  Serial Port As Global Prasanjith 2 3,081 Mar-23-2023, 08:54 PM
Last Post: deanhystad
  Python Serial: How to read the complete line to insert to MySQL? sylar 1 1,680 Mar-21-2023, 10:06 PM
Last Post: deanhystad
Star Pyserial not reading serial.readline fast enough while using AccelStepper on Arduino MartyTinker 4 9,084 Mar-13-2023, 04:02 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020