pyserial: No module named tools

charmoniumQ picture charmoniumQ · Jan 1, 2013 · Viewed 58.4k times · Source

I have installed the latest pySerial on my Ubuntu box with python 2.7.2, and it works fine for most things, but whenever I try to import the 'tools' package, it says that it can't find 'tools'. The documentation for pySerial explicitly references this 'tools' package.

>>> from serial import tools
Traceback (most recent call last):
  File "<pyshell#30>", line 1, in <module>
    import serial.tools
ImportError: No module named tools

and when I:

>>> serial.VERSION
'2.5'

which is the latest version according to Source Forge

So why can't I get to the 'tools' package of pySerial?

Answer

user1881957 picture user1881957 · Jan 1, 2013

Use pip to install pyserial. First install pip:

sudo apt-get install python-pip

After that install pyserial:

sudo pip install pyserial