Monday 23 November 2015

Import a Python module from an egg file

To import a Python module directly from an egg file (eg. to over-ride a globally installed version), you can do this: (eg. for the ete2 module)

sys.path = ['/nfs/users/nfs_a/alc/Documents/git/Python/ete_egg/ete2-2.2.1072-py2.7.egg'] + sys.path # prepend to pythonpath, version 2.2.1072

from ete2 import Tree, SeqMotifFace, TreeStyle, add_face_to_node

No comments: