I have created an exe
file from python
file which is add.py
in my case,
I followed this tutorial Tutorial
My setup.txt file as follows:
from distutils.core import setup
import py2exe
setup(console=['add.py'])
setup(options = { "py2exe": {"includes": ["encodings"]}})
The following is my exe creation step:
I got output exe
file which is add.exe
in this location C:\Python34\dist
. I double clicked it and it is working. When I move that add.exe to another location suppose C:\Python34
or Any other location in my system it is not working. It is giving the following error instead of executing:
I do not have any idea why it is misbehave like this way. I need that exe file to work all my locations. How can I solve this? Any help will be appreciated!!
答案 0 :(得分:2)
setup(
console=['add.py'],
options = {
"py2exe": {
"includes": ["encodings"],
"bundle_files": 1,
"ascii": False
}
},
zipfile = None
)