我将如何使用 py2exe 将 Beautiful soup 与我的代码一起捆绑到 exe 中?
我现在用于 setup.py 的代码是
from distutils.core import setup
import py2exe
# equivalent command line with options is:
# python setup.py py2exe --compressed --bundle-files=2 --dist-dir="my/dist/dir" --dll-excludes="w9xpopen.exe"
options = {'py2exe': {
'compressed':1,
'bundle_files': 1,
'dist_dir': "exe/dist/dir"
'dll_excludes' }}
setup(console=[''], options=options,zipfile = None)
In your options
你可以添加一个属性includes
并以这种方式添加库。一个例子:
options = { "py2exe": {
"includes": ["LIBRARY HERE", ...]
}}
这包括 Py2exe 尚未找到的外部库。如果我没记错的话,Py2exe 应该尝试自行查找依赖项,如果找不到,您可以使用上述方法。
我不确定 Beautiful Soup 的库结构,因为我没有使用过它,但一个例子是:
"includes": ["matplotlib.backends.backend_tkagg"]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)