【发布时间】:2019-03-19 00:48:41
【问题描述】:
当我在 py2exe 中生成脚本时,它会生成 exe,但是当我打开 exe 时,会出现以下错误:
Could not locate script resource: The specified
resource type cannot be found in the image file.
FATAL ERROR: Could not locate script
这是我的 setup.py:
from distutils.core import setup
from setuptools import setup
import py2exe
import sys
sys.argv.append('py2exe')
setup(console=['program.py'])
这是我运行命令生成exe(python setup.py py2exe)时弹出的命令提示符:
running build
running py2exe
6 missing Modules
------------------
? pkg_resources.extern.appdirs imported from pkg_resources
? pkg_resources.extern.packaging imported from pkg_resources
? pkg_resources.extern.six imported from pkg_resources, pkg_resources.py31compat
? readline imported from cmd, code, pdb
? win32api imported from platform
? win32con imported from platform
Building 'dist\program.exe'.
error: [WinError 87] The parameter is incorrect.
我到处搜索,但找不到答案。
谢谢, 佩奇
编辑: 老实说,我不知道这是 py2exe 的问题,还是我的 python 安装或操作系统内部出现问题。我欢迎所有意见和建议。
【问题讨论】:
标签: python python-3.x py2exe