Create easy-install.pth

From Zenoss Wiki
This is the approved revision of this page, as well as being the most recent.
Jump to: navigation, search

If you somehow lose your $ZENHOME/ZenPacks/easy-install.pth file and need to recreate it based on the ZenPacks currently installed on the system, you can do so using the following steps.

Bulbgraph.png Note: Don't do this if you already have an easy-install.pth and you feel that it needs fixed. Odds are, it's already better than what will be created using this approach.

$ cd $ZENHOME/ZenPacks
$ cp easy-install.pth easy-install.pth.orig
$ echo "import sys; sys.__plen = len(sys.path)" > easy-install.pth
$ find . -maxdepth 1 -name \*.egg >> easy-install.pth
$ ls -1 *.egg-link | xargs -n1 head -1 >> easy-install.pth
$ echo "import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)​" >> easy-install.pth​