[Python] "ImportError: No module named serial" - after installing pyserial [duplicate]

Discussão em 'Python' iniciado por Stack, Março 21, 2025.

  1. Stack

    Stack Membro Participativo

    I'm writing a project in python which should eventually running on LinkIt One IoT device.

    I've written some test code to check whether I am able to connect between Arduino IDE to python (I am working with Pycharm).

    the test code is:

    import serial
    import time

    arduino = serial.Serial('COM1', 115200, timeout=.1)

    time.sleep(1) #give the connection a second to settle

    arduino.write("Hello from Python!")

    while True:
    data = arduino.readline()
    if data:
    print data.rstrip('\n')


    when I am running to code I am getting:

    C:\Users\אורי\PycharmProjects\untitled\venv\Scripts\python.exe C:/Users/אורי/PycharmProjects/untitled2/test.py

    Traceback (most recent call last):
    File "C:/Users/����/PycharmProjects/untitled2/test.py", line 1, in <module>
    import serial
    ImportError: No module named serial

    Continue reading...

Compartilhe esta Página