19

我怎么能__init__.pyc在这里打开?

    >>> import stompservice
    <module 'stompservice' from 'C:\Python25\lib\site-packages\stompservice-0.1.0-py2.5.egg\stompservice\__init__.pyc'>

我看到的C:\Python25\lib\site-packages\只是 .egg 文件,但是包的内部文件在哪里?

4

2 回答 2

32

例如,如果您想导入 .egg 文件形式的 suds 模块:

在您的 python 脚本中:

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

sys.path.append(egg_path)

import suds
#... rest of code
于 2013-03-19T10:54:35.457 回答
30

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

.egg 文件只是重命名的 zip 文件。

使用您的 zip 程序打开 egg,或者只是将扩展名重命名为 .zip,然后解压缩。

于 2009-05-12T06:35:16.127 回答