Skip to content Skip to sidebar Skip to footer

How Does Python Import Modules From .egg Files?

How can I open __init__.pyc here? >>> import stompservice

Solution 1:

For example, if you want to import the suds module which is available as .egg file:

In your python script:

egg_path='/home/shahid/suds_2.4.egg'

sys.path.append(egg_path)

import suds
#... rest of code

Solution 2:

http://peak.telecommunity.com/DevCenter/PythonEggs

.egg files are simply renamed zip files.

Open the egg with your zip program, or just rename the extension to .zip, and extract.

Post a Comment for "How Does Python Import Modules From .egg Files?"