Generate addresses from Trezor's xPub using Python I am trying to generate BIP32 HD addresses from my Trezors xPub key.
I keep getting errors with most of the libs our there. What am I missing?

pywallet:

from pywallet import wallet
xpub = 'ypub6Y9NsCaunfAtedv6VX7UTfuvQGLu1TgMtLtjnRydESqWwUSkJnAzATyCzscezpcfoXtgJhAfUTauEQWWt8xvbLxo7qXToCDkJi1Nb1b7wZB'
wallet.create_address(network="BTC", xpub=pub, child=0)
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/usr/local/lib/python3.5/dist-packages/pywallet/wallet.py", line 48, in create_address
    wallet_obj = Wallet.deserialize(xpub, network=network.upper())
  File "/usr/local/lib/python3.5/dist-packages/pywallet/utils/bip32.py", line 557, in deserialize
    version)
pywallet.utils.keys.IncompatibleNetworkException: Incorrect network. Bitcoin Main Net expects a byte prefix of 76067358, but you supplied b'\x04\x9d|\xb2'


The pybitcointools do generate an address, but they do not match the one Trezor generates.

Essentially I need code which replicated Trezor address generation from xPub. Any ideas?
xpub = 'ypub6...
(network="BTC",...    

You are providing a testnet extended public key with the network parameter set as mainnet. I would suggest you either use a mainnet xpub key, or change the network parameter to testnet.