当我在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
这是我的设置。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安装或操作系统内部有什么问题。我欢迎所有意见和建议。