Lucky for you, its already built into Python... pip is a dream to work with...
packaging.python.org/guides/creating-and-discover…
Also, for my own curiosity I spent minimal time googling and found this: github.com/mitsuhiko/pluginbase
lkubuntu.wordpress.com/2012/10/02/writing-a-pytho…
This is not an uncommon problem, as Django and Flask were developed with this exact situation in mind.