Skip to content

Unable to build EXE using 6.0.0 but works fine building with 5.13.2 #7967

Description

@bigwhoopgames

Hello,

I understand this might fall into the antivirus false positive area, however because the application builds on the older version I figured this might be something introduced in 6.0.0.

When trying to build the program using 6.0.0 I get the following error:

PS C:\Users\Derp\Desktop\Game> pyinstaller --noconsole .\game.py
200 INFO: PyInstaller: 6.0.0
200 INFO: Python: 3.11.3
206 INFO: Platform: Windows-10-10.0.19045-SP0
206 INFO: wrote C:\Users\Derp\Desktop\Game\game.spec
212 INFO: Extending PYTHONPATH with paths
['C:\Users\Derp\Desktop\Game']
pygame-ce 2.3.2 (SDL 2.26.5, Python 3.11.3)
522 INFO: checking Analysis
540 INFO: Building because hiddenimports changed
540 INFO: Initializing module dependency graph...
541 INFO: Caching module graph hooks...
559 INFO: Analyzing base_library.zip ...
1527 INFO: Loading module hook 'hook-heapq.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
1595 INFO: Loading module hook 'hook-encodings.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
2807 INFO: Loading module hook 'hook-pickle.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
4004 INFO: Caching module dependency graph...
4082 INFO: Running Analysis Analysis-00.toc
4082 INFO: Looking for Python shared library...
4086 INFO: Using Python shared library: C:\Users\Derp\AppData\Local\Programs\Python\Python311\python311.dll
4087 INFO: Analyzing C:\Users\Derp\Desktop\Game\game.py
4128 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
4254 INFO: Loading module hook 'hook-xml.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
4469 INFO: Loading module hook 'hook-pygame.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\pygame\__pyinstaller'...
pygame-ce 2.3.2 (SDL 2.26.5, Python 3.11.3)
4601 INFO: Loading module hook 'hook-platform.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
4683 INFO: Loading module hook 'hook-difflib.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
4696 INFO: Loading module hook 'hook-numpy.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\numpy\_pyinstaller'...
5565 INFO: Loading module hook 'hook-sysconfig.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
7207 INFO: Loading module hook 'hook-pkg_resources.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
7924 INFO: Loading module hook 'hook-OpenGL.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
11624 INFO: Processing module hooks...
11706 INFO: Processing pre-safe import module hook win32com from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\_pyinstaller_hooks_contrib\hooks\pre_safe_import_module\hook-win32com.py'.
12107 INFO: Loading module hook 'hook-packaging.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
12236 INFO: Looking for ctypes DLLs
12614 INFO: Analyzing run-time hooks ...
12618 INFO: Including run-time hook 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_inspect.py'
12620 INFO: Including run-time hook 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgutil.py'
12622 INFO: Including run-time hook 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgres.py'
12626 INFO: Including run-time hook 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_multiprocessing.py'
12639 INFO: Looking for dynamic libraries
C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\building\build_main.py:194: UserWarning: The numpy.array_api submodule is still experimental. See NEP 47.
import(package)
pygame-ce 2.3.2 (SDL 2.26.5, Python 3.11.3)
13190 INFO: Extra DLL search directories (AddDllDirectory): ['C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\numpy\.libs', 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\pygame']
13190 INFO: Extra DLL search directories (PATH): []
13641 INFO: Warnings written to C:\Users\Derp\Desktop\Game\build\game\warn-game.txt
13723 INFO: Graph cross-reference written to C:\Users\Derp\Desktop\Game\build\game\xref-game.html
13753 INFO: checking PYZ
13770 INFO: Building because toc changed
13770 INFO: Building PYZ (ZlibArchive) C:\Users\Derp\Desktop\Game\build\game\PYZ-00.pyz
14547 INFO: Building PYZ (ZlibArchive) C:\Users\Derp\Desktop\Game\build\game\PYZ-00.pyz completed successfully.
14568 INFO: checking PKG
14574 INFO: Building because PKG-00.toc is bad
14574 INFO: Building PKG (CArchive) game.pkg
14594 INFO: Building PKG (CArchive) game.pkg completed successfully.
14595 INFO: Bootloader C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\bootloader\Windows-64bit-intel\runw.exe
14595 INFO: checking EXE
14603 INFO: Building because manifest changed
14603 INFO: Building EXE from EXE-00.toc
14604 INFO: Copying bootloader EXE to C:\Users\Derp\Desktop\Game\build\game\game.exe
14702 INFO: Copying icon to EXE
Traceback (most recent call last):
File "C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 33, in pywin32error
yield
File "C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\win32ctypes\pywin32\win32api.py", line 209, in BeginUpdateResource
return _resource._BeginUpdateResource(filename, delete)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\win32ctypes\core\ctypes_util.py", line 39, in check_null
raise make_error(function, function_name)
OSError: [WinError 225] Operation did not complete successfully because the file contains a virus or potentially unwanted software.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Users\Derp\AppData\Local\Programs\Python\Python311\Scripts\pyinstaller.exe_main
.py", line 7, in
File "C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller_main
.py", line 205, in console_script_run
run()
File "C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller_main
.py", line 189, in run
run_build(pyi_config, spec_file, **vars(args))
File "C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller_main_.py", line 61, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\building\build_main.py", line 1033, in main
build(specfile, distpath, workpath, clean_build)
File "C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\building\build_main.py", line 973, in build
exec(code, spec_namespace)
File "C:\Users\Derp\Desktop\Game\game.spec", line 18, in
exe = EXE(
^^^^
File "C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\building\api.py", line 625, in init
self.postinit()
File "C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\building\datastruct.py", line 184, in postinit
self.assemble()
File "C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\building\api.py", line 738, in assemble
self._retry_operation(icon.CopyIcons, build_name, self.icon)
File "C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\building\api.py", line 992, in _retry_operation
return func(*args)
^^^^^^^^^^^
File "C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\utils\win32\icon.py", line 209, in CopyIcons
return CopyIcons_FromIco(dstpath, [srcpath])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Derp\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\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\win32ctypes\pywin32\win32api.py", line 208, in BeginUpdateResource
with _pywin32error():
File "C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 155, in exit
self.gen.throw(typ, value, traceback)
File "C:\Users\Derp\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.')

When using 5.13.2 the operation succeeds and I get an EXE no problem:

PS C:\Users\Derp\Desktop\Game> pip install pyinstaller==5.13.2
Collecting pyinstaller==5.13.2
Obtaining dependency information for pyinstaller==5.13.2 from https://files.pythonhosted.org/packages/1a/74/c65be869ae47649b98a928b3122c27d72fe372138aab4dc6cdd42e217d8a/pyinstaller-5.13.2-py3-none-win_amd64.whl.metadata
Downloading pyinstaller-5.13.2-py3-none-win_amd64.whl.metadata (8.3 kB)
Requirement already satisfied: setuptools>=42.0.0 in c:\users\derp\appdata\local\programs\python\python311\lib\site-packages (from pyinstaller==5.13.2) (65.5.0)
Requirement already satisfied: altgraph in c:\users\derp\appdata\local\programs\python\python311\lib\site-packages (from pyinstaller==5.13.2) (0.17.3)
Requirement already satisfied: pyinstaller-hooks-contrib>=2021.4 in c:\users\derp\appdata\local\programs\python\python311\lib\site-packages (from pyinstaller==5.13.2) (2023.2)
Requirement already satisfied: pefile>=2022.5.30 in c:\users\derp\appdata\local\programs\python\python311\lib\site-packages (from pyinstaller==5.13.2) (2023.2.7)
Requirement already satisfied: pywin32-ctypes>=0.2.1 in c:\users\derp\appdata\local\programs\python\python311\lib\site-packages (from pyinstaller==5.13.2) (0.2.2)
Downloading pyinstaller-5.13.2-py3-none-win_amd64.whl (1.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 16.2 MB/s eta 0:00:00
Installing collected packages: pyinstaller
Successfully installed pyinstaller-5.13.2
PS C:\Users\Derp\Desktop\Game> pyinstaller --noconsole .\game.py
324 INFO: PyInstaller: 5.13.2
324 INFO: Python: 3.11.3
329 INFO: Platform: Windows-10-10.0.19045-SP0
330 INFO: wrote C:\Users\Derp\Desktop\Game\game.spec
336 INFO: Extending PYTHONPATH with paths
['C:\Users\Derp\Desktop\Game']
pygame-ce 2.3.2 (SDL 2.26.5, Python 3.11.3)
660 INFO: checking Analysis
668 INFO: Building because Analysis-00.toc is bad
668 INFO: Initializing module dependency graph...
669 INFO: Caching module graph hooks...
691 INFO: Analyzing base_library.zip ...
2320 INFO: Loading module hook 'hook-heapq.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
2436 INFO: Loading module hook 'hook-encodings.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
4281 INFO: Loading module hook 'hook-pickle.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
6772 INFO: Caching module dependency graph...
6859 INFO: running Analysis Analysis-00.toc
6862 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by C:\Users\Derp\AppData\Local\Programs\Python\Python311\python.exe
6893 INFO: Analyzing C:\Users\Derp\Desktop\Game\game.py
6957 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
7107 INFO: Loading module hook 'hook-xml.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
7484 INFO: Loading module hook 'hook-pygame.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\pygame\__pyinstaller'...
pygame-ce 2.3.2 (SDL 2.26.5, Python 3.11.3)
7626 INFO: Loading module hook 'hook-platform.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
7781 INFO: Loading module hook 'hook-difflib.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
7815 INFO: Loading module hook 'hook-numpy.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\numpy\_pyinstaller'...
9550 INFO: Loading module hook 'hook-sysconfig.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
11908 INFO: Loading module hook 'hook-pkg_resources.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
12829 INFO: Loading module hook 'hook-OpenGL.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
18794 INFO: Processing module hooks...
19007 INFO: Processing pre-safe import module hook win32com from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\_pyinstaller_hooks_contrib\hooks\pre_safe_import_module\hook-win32com.py'.
19688 INFO: Loading module hook 'hook-packaging.py' from 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks'...
19950 INFO: Looking for ctypes DLLs
20332 INFO: Analyzing run-time hooks ...
20336 INFO: Including run-time hook 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_inspect.py'
20338 INFO: Including run-time hook 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgutil.py'
20340 INFO: Including run-time hook 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgres.py'
20344 INFO: Including run-time hook 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_multiprocessing.py'
20357 INFO: Looking for dynamic libraries
C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\building\build_main.py:167: UserWarning: The numpy.array_api submodule is still experimental. See NEP 47.
import(package)
pygame-ce 2.3.2 (SDL 2.26.5, Python 3.11.3)
409 INFO: No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'
512 INFO: Extra DLL search directories (AddDllDirectory): ['C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\numpy\.libs', 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\pygame']
513 INFO: Extra DLL search directories (PATH): ['C:\Windows\system32', 'C:\Windows', 'C:\Windows\System32\Wbem', 'C:\Windows\System32\WindowsPowerShell\v1.0\', 'C:\Windows\System32\OpenSSH\', 'C:\Program Files\Microsoft VS Code\bin', 'C:\Program Files\Git\cmd', 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Scripts\', 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\', 'C:\Users\Derp\AppData\Local\Microsoft\WindowsApps', 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\pygame', 'C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\pygame']
21478 INFO: Looking for eggs
21479 INFO: Found binding redirects:
[]
21486 INFO: Warnings written to C:\Users\Derp\Desktop\Game\build\game\warn-game.txt
21568 INFO: Graph cross-reference written to C:\Users\Derp\Desktop\Game\build\game\xref-game.html
21598 INFO: checking PYZ
21604 INFO: Building because toc changed
21604 INFO: Building PYZ (ZlibArchive) C:\Users\Derp\Desktop\Game\build\game\PYZ-00.pyz
22368 INFO: Building PYZ (ZlibArchive) C:\Users\Derp\Desktop\Game\build\game\PYZ-00.pyz completed successfully.
22390 INFO: checking PKG
22391 INFO: Building because cdict changed
22391 INFO: Building PKG (CArchive) game.pkg
22412 INFO: Building PKG (CArchive) game.pkg completed successfully.
22413 INFO: Bootloader C:\Users\Derp\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyInstaller\bootloader\Windows-64bit-intel\runw.exe
22414 INFO: checking EXE
22415 INFO: Rebuilding EXE-00.toc because game.exe missing
22415 INFO: Building EXE from EXE-00.toc
22415 INFO: Copying bootloader EXE to C:\Users\Derp\Desktop\Game\build\game\game.exe.notanexecutable
23338 INFO: Copying icon to EXE
24130 INFO: Writing RT_GROUP_ICON 0 resource with 104 bytes
24130 INFO: Writing RT_ICON 1 resource with 3752 bytes
24130 INFO: Writing RT_ICON 2 resource with 2216 bytes
24130 INFO: Writing RT_ICON 3 resource with 1384 bytes
24130 INFO: Writing RT_ICON 4 resource with 38188 bytes
24131 INFO: Writing RT_ICON 5 resource with 9640 bytes
24131 INFO: Writing RT_ICON 6 resource with 4264 bytes
24131 INFO: Writing RT_ICON 7 resource with 1128 bytes
24133 INFO: Copying 0 resources to EXE
24133 INFO: Embedding manifest in EXE
24134 INFO: Updating manifest in C:\Users\Derp\Desktop\Game\build\game\game.exe.notanexecutable
24167 INFO: Updating resource type 24 name 1 language 0
24170 INFO: Appending PKG archive to EXE
24178 INFO: Fixing EXE headers
24590 INFO: Building EXE from EXE-00.toc completed successfully.
24592 INFO: checking COLLECT
24593 INFO: Building COLLECT because COLLECT-00.toc is non existent
24593 INFO: Building COLLECT COLLECT-00.toc
24877 INFO: Building COLLECT COLLECT-00.toc completed successfully.

Please let me know if there is anything I can do to help investigate what might be causing this difference between 5.13.2 and 6.0.0.

Thanks for taking a look.

Metadata

Metadata

Assignees

No one assigned

    Labels

    antivirus-false-positivesFor reports (usually from virus-total) that PyInstaller generated files are malware.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions