This module encapsulates the access for the serial port. It provides backends for Python running on Windows, OSX, Linux, BSD (possibly any POSIX compliant system) and IronPython. The module named “serial” automatically selects the appropriate backend.
It is released under a free software license, see LICENSE for more details.
Copyright (C) 2001-2016 Chris Liechti <cliechti(at)gmx.net>
Other pages (online)
For older installations (older Python versions or older operating systems), see older versions below.
This installs a package that can be used from Python (import serial).
To install for all users on the system, administrator rights (root) may be required.
pySerial can be installed from PyPI:
python -m pip install pyserial
Using the python/python3 executable of the desired version (2.7/3.x).
Developers also may be interested to get the source archive, because it contains examples, tests and the this documentation.
Download the archive from http://pypi.python.org/pypi/pyserial or https://github.com/pyserial/pyserial/releases. Unpack the archive, enter the pyserial-x.y directory and run:
python setup.py install
Using the python/python3 executable of the desired version (2.7/3.x).
There are also packaged versions for some Linux distributions:
Note that some distributions may package an older version of pySerial. These packages are created and maintained by developers working on these distributions.
Older versions are still available on the current download page or the old download page. The last version of pySerial’s 2.x series was 2.7, compatible with Python 2.3 and newer and partially with early Python 3.x versions.
pySerial 1.21 is compatible with Python 2.0 on Windows, Linux and several un*x like systems, MacOSX and Jython.
On Windows, releases older than 2.5 will depend on pywin32 (previously known as win32all). WinXP is supported up to 3.0.1.