Closed Duckyal closed 10 months ago
At least provide a stacktrace please.
Nevermind, presumably it's this line:
那应该如何修改呢,我还想是不是python版本问题
File "E:\python\抢课\抢课.spec", line 18, in <module>
exe = EXE(
File "C:\python\lib\site-packages\PyInstaller\building\api.py", line 628, in __init__
self.__postinit__()
File "C:\python\lib\site-packages\PyInstaller\building\datastruct.py", line 184, in __postinit__
self.assemble()
File "C:\python\lib\site-packages\PyInstaller\building\api.py", line 752, in assemble
self._retry_operation(winmanifest.write_manifest_to_executable, build_name, self.manifest)
File "C:\python\lib\site-packages\PyInstaller\building\api.py", line 995, in _retry_operation
return func(*args)
File "C:\python\lib\site-packages\PyInstaller\utils\win32\winmanifest.py", line 210, in write_manifest_to_executable
winresource.add_or_update_resource(filename, manifest_xml, RT_MANIFEST, names, languages)
File "C:\python\lib\site-packages\PyInstaller\utils\win32\winresource.py", line 151, in add_or_update_resource
win32api.UpdateResource(module_handle, res_type, res_name, data, language=res_lang)
TypeError: UpdateResource() takes no keyword arguments
What version of pywin32-ctypes
do you have installed?
That keyword argument has been there since pywin32-ctypes
0.1.0, and PyInstaller >= 5.13 explicitly requires pywin32-ctypes >= 0.2.1
.
Does it work if you edit C:\python\lib\site-packages\PyInstaller\utils\win32\winresource.py
and change line 151 from
win32api.UpdateResource(module_handle, res_type, res_name, data, language=res_lang)
to
win32api.UpdateResource(module_handle, res_type, res_name, data, res_lang)
pywin32-ctypes的版本为0.2.2 改了之后,能够很好的完成打包,非常感谢
What does C:\python\python -m pip freeze
say?
引用了python 3.10.9·pyinstaller 6.1.0·imagehash 4.3.1·pyperclip 1.8.2和pyautogui 0.9.54模块,但是报错,打包的程序也用不了