问题描述
我怎么会去捆绑,比如说,美丽的汤成一个exe与我的code。使用py2exe沿?
在code现在我用我的setup.py是
从distutils.core进口设置
进口py2exe#与等效的选项命令行是:
#蟒蛇setup.py py2exe --com pressed --bundle-文件= 2 --dist-DIR =我/距离/ DIR--dll-排除=w9xpopen.exe
选项= {'py2exe:{
COM pressed':1,
'bundle_files':1,
dist_dir:EXE /距离/目录
dll_excludes'}}设置(控制台= [''],选择=选项,zip文件=无)
在你的选项
您可以添加属性包括
并添加库的方式。举个例子:
选项= {py2exe:{
包括:LIBRARY HERE,...]
}}
这包括那些尚未被发现由Py2exe外部库。如果我没有记错,Py2exe应该设法找到它自己的依赖和任何它没有找到,您可以使用上面的方法。
我不知道库结构美丽的汤,因为我已经没有使用它,而是一个例子是:
包含:matplotlib.backends.backend_tkagg]
How would I go about bundling, say, Beautiful soup into an exe along with my code using py2exe?
The code I am using for my setup.py right now is
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
you can add an attribute includes
and add the libraries that way. An example:
options = { "py2exe": {
"includes": ["LIBRARY HERE", ...]
}}
This includes external libraries that haven't already been found by Py2exe. If I remember correctly, Py2exe should try to find the dependencies on it's own and any it doesn't find you can use the above method.
I'm not sure about the library structure for Beautiful Soup as I've not used it, but an example would be:
"includes": ["matplotlib.backends.backend_tkagg"]
这篇关于第三方库和Py2exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!