I am learning Python and need to monitor a serial port.
i am using Pycharm with the following code.
import serial
ser = serial.Serial('com6', 9600)
while True:
s = ser.read(10000)
print(s)
This gives the error: AttributeError: module 'serial' has no attribute 'Serial'
PS. I have installed "serial" in pycharms python interpreter
Not sure what is wrong...
I am learning Python and need to monitor a serial port.
i am using Pycharm with the following code.
import serial
ser = serial.Serial('com6', 9600)
while True:
s = ser.read(10000)
print(s)
This gives the error: AttributeError: module 'serial' has no attribute 'Serial'
PS. I have installed "serial" in pycharms python interpreter
Not sure what is wrong...
Share Improve this question asked Nov 16, 2024 at 14:36 Fred_was_hereFred_was_here 12 bronze badges 1 |1 Answer
Reset to default 0I found the solution.
So, in PyCharm you need to install pyserial not serial, even though in code you call it as as serial! Of course!!!
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745656440a4638570.html
serial.py
anywhere in the same folder ? – Ahmed AEK Commented Nov 16, 2024 at 14:38