New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pyinstaller: DOS Header magic not found #7982
Comments
Can you re-run with added |
that output is massive -> added as .txt file (at buttom) Output
|
The last message before the error:
Do you happen to know which package installed this file? |
i installed gsmh myself (and my project-leader told me to do) (OCC) PS C:\Users\Student\desktop\best> pip install gmsh |
Thanks for the info! I can reproduce the problem with a simple As a work-around, you can (temporarily) rename that file, or remove it altogether if you are not calling the In the meantime, I'll check what's going on with the mis-detection and what we can do to guard against such cases. |
unfortunately this did not help in my case, should i share my new PyInstallerLog? Would you share your strategy to look through this log? ill meet my boss in a minute, maybe he has an idea that i would add here afterwards |
Are you still getting error during build, or is it a run-time error now? |
error during build: Still the DOS header magic not found. |
If you run with |
my prompt (gmsh in .envs/occ/scripts)
prompt (with gmsh deleted from ./envs/occ/scripts) and this one is from by boss:
I'll try the hook now you mentioned in the dialog, this may above my horizont yet |
You need to remove all instances of that
seems to suggest that you have another python installation and its scripts directory in If you don't want to deal with cleaning those up, you might want to use the
which should ignore those For the hook, you can install the
|
The PyInstaller python I've been grappling with this for four days now. Is this worthy of a new topic, or should I continue in this existing thread? Apologies for my confusion; this is my first post, and I don't want to inadvertently flood the GitHub discussions. |
Hey, im new in dev's, can't tell which bib/path(?) is blocking the pyinstaller (merging to one exe-file)
" raise PEFormatError("DOS Header magic not found.")
pefile.PEFormatError: 'DOS Header magic not found.'"
My System:
Anaconda.Navigator 2.5.0 (Python 3.10.5 Environment ("OCC")
VirsualStudioCode 1.82.3
Windows 11 x64
My Imports:
import trimesh
import trimesh.creation
import trimesh.repair
import trimesh.ray.ray_triangle as ray
import trimesh.exchange.load
import numpy as np
from sklearnex import patch_sklearn
patch_sklearn()
from sklearn.neighbors import KDTree
from sklearn.cluster import MeanShift
import time
import wx
import sys
import os
import logging
import math
import argparse
import configparser
has someone fought this before?
appreciate any/every help
(OCC) PS C:\Users\Student\desktop\best> pyinstaller --onefile --noconfirm .\tree_11c_DatenViaPromptPyInstaller.py
892 INFO: PyInstaller: 6.0.0
892 INFO: Python: 3.10.5 (conda)
905 INFO: Platform: Windows-10-10.0.22621-SP0
907 INFO: wrote C:\Users\Student\desktop\best\tree_11c_DatenViaPromptPyInstaller.spec
910 INFO: Extending PYTHONPATH with paths
['C:\Users\Student\desktop\best']
1228 INFO: checking Analysis
1228 INFO: Building Analysis because Analysis-00.toc is non existent
1228 INFO: Initializing module dependency graph...
1228 INFO: Caching module graph hooks...
1263 INFO: Analyzing base_library.zip ...
3356 INFO: Loading module hook 'hook-heapq.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
3417 INFO: Loading module hook 'hook-encodings.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
5457 INFO: Loading module hook 'hook-pickle.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
6476 INFO: Caching module dependency graph...
6600 INFO: Running Analysis Analysis-00.toc
6600 INFO: Looking for Python shared library...
6608 INFO: Using Python shared library: C:\Users\Student\anaconda3\envs\OCC\python310.dll
6608 INFO: Analyzing C:\Users\Student\desktop\best\tree_11c_DatenViaPromptPyInstaller.py
6633 INFO: Loading module hook 'hook-trimesh.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
6777 INFO: Loading module hook 'hook-numpy.py' from 'C:\Users\Student\anaconda3\envs\OCC\Lib\site-packages\numpy\_pyinstaller'...
7292 INFO: Loading module hook 'hook-difflib.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
7475 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
7610 INFO: Loading module hook 'hook-xml.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
8152 INFO: Loading module hook 'hook-platform.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
8404 INFO: Loading module hook 'hook-sysconfig.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
9455 INFO: Processing pre-safe import module hook distutils from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks\pre_safe_import_module\hook-distutils.py'.
9455 INFO: Processing pre-find module path hook distutils from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks\pre_find_module_path\hook-distutils.py'.
9778 INFO: Loading module hook 'hook-distutils.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
9988 INFO: Loading module hook 'hook-scipy.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
10098 INFO: Loading module hook 'hook-pycparser.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
10557 INFO: Loading module hook 'hook-distutils.util.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
10653 INFO: Loading module hook 'hook-setuptools.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
13469 INFO: Loading module hook 'hook-packaging.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
13941 INFO: Loading module hook 'hook-pkg_resources.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
16403 INFO: Loading module hook 'hook-scipy.linalg.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
16656 INFO: Loading module hook 'hook-scipy.sparse.csgraph.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
17438 INFO: Loading module hook 'hook-scipy.spatial.transform.rotation.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
20630 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
20963 INFO: Loading module hook 'hook-rtree.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
22378 INFO: Loading module hook 'hook-charset_normalizer.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
22482 INFO: Loading module hook 'hook-cryptography.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
25143 INFO: Loading module hook 'hook-certifi.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
26177 INFO: Loading module hook 'hook-sklearn.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
26643 INFO: Loading module hook 'hook-sklearn.utils.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
27154 INFO: Loading module hook 'hook-sklearn.metrics.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
29573 INFO: Loading module hook 'hook-sklearn.metrics.cluster.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
29794 INFO: Loading module hook 'hook-sklearn.cluster.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
29844 INFO: Loading module hook 'hook-sklearn.metrics.pairwise.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
30008 INFO: Loading module hook 'hook-sklearn.neighbors.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
30169 INFO: Loading module hook 'hook-sklearn.linear_model.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
31204 INFO: Loading module hook 'hook-sklearn.tree.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
38128 INFO: Loading module hook 'hook-xml.dom.domreg.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
40916 INFO: Processing module hooks...
40917 WARNING: Hidden import "charset_normalizer.md__mypyc" not found!
40921 WARNING: Hidden import "sklearn.neighbors._typedefs" not found!
41279 INFO: Loading module hook 'hook-scipy.special._ellip_harm_2.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
41280 INFO: Loading module hook 'hook-scipy.special._ufuncs.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
41281 INFO: Loading module hook 'hook-scipy.stats._stats.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
41308 INFO: Loading module hook 'hook-setuptools.msvc.py' from 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks'...
42230 INFO: Looking for ctypes DLLs
42309 INFO: Analyzing run-time hooks ...
42323 INFO: Including run-time hook 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_inspect.py'
42326 INFO: Including run-time hook 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_multiprocessing.py'
42330 INFO: Including run-time hook 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgutil.py'
42334 INFO: Including run-time hook 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_setuptools.py'
42335 INFO: Including run-time hook 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgres.py'
42406 INFO: Looking for dynamic libraries
C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\building\build_main.py:194: UserWarning: The numpy.array_api submodule is still experimental. See NEP 47.
import(package)
44179 INFO: Extra DLL search directories (AddDllDirectory): ['C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\scipy\.libs', 'C:\Users\Student\anaconda3\envs\OCC\Library\bin', 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\daal4py\oneapi', 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\daal4py\oneapi', 'C:\Users\Student\anaconda3\envs\OCC\Lib\site-packages\daal4py\oneapi', 'C:\Users\Student\anaconda3\envs\OCC\Library\bin', 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\daal4py\oneapi', 'C:\Users\Student\anaconda3\envs\OCC\Lib\site-packages\daal4py\oneapi']
44179 INFO: Extra DLL search directories (PATH): ['C:\Users\Student\anaconda3\envs\OCC\Lib\site-packages\daal4py\oneapi', 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\daal4py\oneapi', 'C:\Users\Student\anaconda3\envs\OCC\Lib\site-packages\daal4py\oneapi', 'C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\daal4py\oneapi']
Traceback (most recent call last):
File "C:\Users\Student\anaconda3\envs\OCC\lib\runpy.py", line 196, in run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users\Student\anaconda3\envs\OCC\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\Student\anaconda3\envs\OCC\Scripts\pyinstaller.exe_main.py", line 7, in
File "C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller_main.py", line 205, in console_script_run
run()
File "C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller_main.py", line 189, in run
run_build(pyi_config, spec_file, **vars(args))
File "C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller_main.py", line 61, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\building\build_main.py", line 1033, in main
build(specfile, distpath, workpath, clean_build)
File "C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\building\build_main.py", line 973, in build
exec(code, spec_namespace)
File "C:\Users\Student\desktop\best\tree_11c_DatenViaPromptPyInstaller.spec", line 4, in
a = Analysis(
File "C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\building\build_main.py", line 466, in init
self.postinit()
File "C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\building\datastruct.py", line 184, in postinit
self.assemble()
File "C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\building\build_main.py", line 791, in assemble
self.binaries.extend(find_binary_dependencies(self.binaries, collected_packages))
File "C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\building\build_main.py", line 230, in find_binary_dependencies
return bindepend.binary_dependency_analysis(binaries, search_paths=extra_libdirs)
File "C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\depend\bindepend.py", line 146, in binary_dependency_analysis
for dep_name, dep_src_path in get_imports(src_name, search_paths):
File "C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\depend\bindepend.py", line 236, in get_imports
return _get_imports_pefile(filename, search_paths)
File "C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\PyInstaller\depend\bindepend.py", line 253, in _get_imports_pefile
pe = pefile.PE(filename, fast_load=True)
File "C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\pefile.py", line 2895, in init
self.parse(name, data, fast_load)
File "C:\Users\Student\anaconda3\envs\OCC\lib\site-packages\pefile.py", line 3031, in parse
raise PEFormatError("DOS Header magic not found.")
pefile.PEFormatError: 'DOS Header magic not found.'
The text was updated successfully, but these errors were encountered: