*win32ctypes.pywin32.pywintypes.error 在 VS Code 中使用 pyinstaller 时出现错误 - 可能是病毒/木马?

tri*_*zzo 7 python virus pywin32 pyinstaller

我正在使用 pyinstaller 为我的 python.py 文件生成可执行代码。但是,我收到此错误:

File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\utils\win32\icon.py", line 143, in CopyIcons_FromIco
    hdst = win32api.BeginUpdateResource(dstpath, 0)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python311\Lib\site-packages\win32ctypes\pywin32\win32api.py", line 208, in BeginUpdateResource
    with _pywin32error():
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python311\Lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 37, in pywin32error
    raise error(exception.winerror, exception.function, exception.strerror)
**win32ctypes.pywin32.pywintypes.error: (225, 'BeginUpdateResourceW', 'Operation did not complete successfully because the file contains a virus or potentially unwanted software.')**
Run Code Online (Sandbox Code Playgroud)

我的防病毒软件声称运行 pyinstaller 时存在病毒:Trojan:Win64/Malgent!MSR

我尝试卸载python,重新安装,但没有任何结果

小智 14

今天,我在 Windows 11 上使用最新的 pyinstaller (6.0.0) 时遇到了类似的问题。对我来说,更改为旧版本 (5.13.2) 解决了该问题。


小智 2

尝试不要在pyinstaller. 以前,我使用\xe2\x80\xa6

\n
pyinstaller --onefile -w image.py \n
Run Code Online (Sandbox Code Playgroud)\n

\xe2\x80\xa6 并遇到了同样的问题。但是当我这样做时\xe2\x80\xa6

\n
pyinstaller --onefile image.py \n
Run Code Online (Sandbox Code Playgroud)\n

\xe2\x80\xa6 很好。

\n