Python 文件到 exe 不能在我电脑的所有位置工作只在 python 安装的 dist 文件夹中工作
Python file to exe not working in all locations in my computer only works in dist folder in python installation
我从 python
文件创建了一个 exe
文件,在我的例子中是 add.py
,
我遵循了本教程 Tutorial
我的setup.txt文件如下:
from distutils.core import setup
import py2exe
setup(console=['add.py'])
setup(options = { "py2exe": {"includes": ["encodings"]}})
以下是我创建exe的步骤:
我在这个位置 C:\Python34\dist
得到了输出 exe
文件,它是 add.exe
。我双击它,它正在工作。当我将 add.exe 移动到另一个位置时,假设 C:\Python34
或我系统中的任何其他位置它不工作。它给出以下错误而不是执行:
我不知道为什么会这样。我需要那个 exe 文件来处理我所有的位置。我该如何解决这个问题?任何帮助将不胜感激!!
setup(
console=['add.py'],
options = {
"py2exe": {
"includes": ["encodings"],
"bundle_files": 1,
"ascii": False
}
},
zipfile = None
)
我从 python
文件创建了一个 exe
文件,在我的例子中是 add.py
,
我遵循了本教程 Tutorial
我的setup.txt文件如下:
from distutils.core import setup
import py2exe
setup(console=['add.py'])
setup(options = { "py2exe": {"includes": ["encodings"]}})
以下是我创建exe的步骤:
我在这个位置 C:\Python34\dist
得到了输出 exe
文件,它是 add.exe
。我双击它,它正在工作。当我将 add.exe 移动到另一个位置时,假设 C:\Python34
或我系统中的任何其他位置它不工作。它给出以下错误而不是执行:
我不知道为什么会这样。我需要那个 exe 文件来处理我所有的位置。我该如何解决这个问题?任何帮助将不胜感激!!
setup(
console=['add.py'],
options = {
"py2exe": {
"includes": ["encodings"],
"bundle_files": 1,
"ascii": False
}
},
zipfile = None
)