AttributeError: module 'serial' has no attribute 'to_bytes'
0
votes
1
answer
813
views
Iam trying to program Arduino Uno using python program. My python version is python 3.8. I successfully installed the pyfirmata2. but when i tried to import pyfirmata2 from command line iam getting the following error.
>>> import pyfirmata2
Traceback (most recent call last):
File "", line 1, in
File "C:\Python38\lib\site-packages\pyfirmata2\__init__.py", line 2, in
from .pyfirmata2 import * # NOQA
File "C:\Python38\lib\site-packages\pyfirmata2\pyfirmata2.py", line 7, in
import serial.tools.list_ports
File "C:\Python38\lib\site-packages\serial\tools\list_ports.py", line 27, in
from serial.tools.list_ports_windows import *
File "C:\Python38\lib\site-packages\serial\tools\list_ports_windows.py", line 127, in
Ports = serial.to_bytes([80, 111, 114, 116, 115]) # "Ports"
AttributeError: module 'serial' has no attribute 'to_bytes'
Asked by vijayakumar sargunam
(11 rep)
Nov 18, 2020, 05:39 AM
Last activity: Nov 18, 2020, 07:15 PM
Last activity: Nov 18, 2020, 07:15 PM