This document describes the prerequisites and the installation of Autobahn.
Autobahn runs on Python on top of these networking frameworks:
You will need at least one of those.
Note
Most of Autobahn’s WebSocket and WAMP features are available on both Twisted and asyncio, so you are free to choose the underlying networking framework based on your own criteria.
For Twisted installation, please see here. Asyncio comes bundled with Python 3.4+. For Python 3.3, install it from here. For Python 2, trollius will work.
Here are the configurations supported by Autobahn:
Python | Twisted | asyncio | Notes |
CPython 2.6 | yes | yes | asyncio support via trollius |
CPython 2.7 | yes | yes | asyncio support via trollius |
CPython 3.3 | yes | yes | asyncio support via tulip |
CPython 3.4+ | yes | yes | asyncio in the standard library |
PyPy 2.2+ | yes | yes | asyncio support via trollius |
Jython 2.7+ | yes | ? | Issues: 1, 2 |
Autobahn is portable, well tuned code. You can further accelerate performance by
acceleration
for that - see below)To give you an idea of the performance you can expect, here is a blog post benchmarking Autobahn running on the RaspberryPi (a tiny embedded computer) under PyPy.
To install Autobahn from the Python Package Index using Pip
pip install autobahn
You can also specify install variants (see below). E.g. to install Twisted automatically as a dependency
pip install autobahn[twisted]
And to install asyncio backports automatically when required
pip install autobahn[asyncio]
To install from sources, clone the repository
git clone git@github.com:tavendo/AutobahnPython.git
checkout a tagged release
cd AutobahnPython
git checkout v0.9.1
Warning
You should only use tagged releases, not trunk. The latest code from trunk might be broken, unfinished and untested. So you have been warned;)
Then do
cd autobahn
python setup.py install
You can also use Pip for the last step, which allows to specify install variants (see below)
pip install -e .[twisted]
Autobahn has the following install variants:
Variant | Description |
twisted |
Install Twisted as a dependency |
asyncio |
Install asyncio as a dependency (or use stdlib) |
accelerate |
Install native acceleration packages on CPython |
compress |
Install packages for non-standard WebSocket compression methods |
serialization |
Install packages for additional WAMP serialization formats (currently MsgPack) |
Install variants can be combined, e.g. to install Autobahn with all optional packages for use with Twisted on CPython:
pip install autobahn[twisted,accelerate,compress,serialization]
For convenience, here are minimal instructions to install both Python and Autobahn/Twisted on Windows:
C:\Python27;C:\Python27\Scripts;
to your PATH
python get-pip.py
from a command shell)pip install autobahn[twisted]
To check the installation, fire up the Python and run
>>> from autobahn import __version__
>>> print(__version__)
0.9.1
To require Autobahn as a dependency of your package, include the following in your setup.py
script
install_requires = ["autobahn>=0.9.1"]
You can also depend on an install variant which automatically installs dependent packages
install_requires = ["autobahn[twisted]>=0.9.1"]
The latter will automatically install Twisted as a dependency.
Where to go
Now you’ve got Autobahn installed, depending on your needs, head over to