On your charms code, put a trace exception
from charmhelpers.contrib.python import pdb
@hooks.hook()
def install():
pdb.set_trace()
...
Then install the python juju plugins on your local machine
$ git clone https://github.com/juju/plugins.git ~/.juju-plugins
$ echo 'PATH=$PATH:$HOME/.juju-plugins' >> ~/.bash_profile
$ source ~/.bash_profile
Then deploy your charm
$ juju deploy charm
Once your pdb trace is raised, connect to your unit:
$ juju pdb --unit charm/0
Done.