This part of the documentation covers the installation of bencoding.
Installing bencoding is simple with pip:
$ pip install bencoding