If zip-safe exists, it means that the project will work properly when installed as an .egg zipfile, and conversely the existence of not-zip-safe means the project should not be installed as an .egg file [ie. as an .egg directory]. The zip_safe option to setuptools' setup() determines which file will be written. If the option isn't provided, setuptools attempts to make its own assessment of whether the package can work, based on code and content analysis.
The Internal Structure of Python Eggs, Zip Support Metadata:
一个egg文件实际上是一个zip归档文件,里面有一个特定的目录结构。根据zipimport文档,只能从zip文件导入
.py
、.pyc
和.pyo
文件。因此,如果包需要导入其他类型的模块资源(比如编译的c代码;.so
文件,.pyd
文件),它就不能作为zip文件工作。我不知道这是否是一些鸡蛋不能用作压缩文件的唯一原因,但我认为这是主要原因。
相关问题 更多 >
编程相关推荐