2

Hi I've got problems importing pyserial in both python 2.7 and 3.5 I've tried with pip install, easy_install, deb package, source balls. But always the same :

>>> import serial
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named serial
>>>

Could you help me, please

2
  • 1
    Are you sure it is installed on your system? How did you install it? Mar 4, 2016 at 9:11
  • run this command: pip list | grep pyserial see if it return anything. if so, share it here Mar 4, 2016 at 9:13

1 Answer 1

2

You should install the packages python-serial and python3-serial using the apt package manager:

sudo apt-get install python-serial python3-serial

Now you can import the module from both Python 2 and 3 with the name serial:

python -c "import serial; print(serial.__file__)"
python3 -c "import serial; print(serial.__file__)"

If those two example commands show you the file where the serial module is located, it works correctly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .