2

Recently updated my computer to Windows 10 and now pyinstaller is throwing an error. This has been working on my Windows 7 computer for as long as I can remember.

I have tried uninstalling and reinstalling pyinstaller, win32 extentions, and several other things.

Any ideas what could be wrong with my computer settings?

pyinstaller ZENTRAUtility.spec
328 INFO: PyInstaller: 3.3.1
328 INFO: Python: 2.7.14
328 INFO: Platform: Windows-10-10.0.16299
331 INFO: UPX is not available.
332 INFO: Extending PYTHONPATH with paths
['C:\\Users\\mthornbrugh\\PycharmProjects\\ZentraUtility',
 'C:\\Users\\mthornbrugh\\PycharmProjects\\ZentraUtility']
332 INFO: checking Analysis
347 INFO: Building because out00-Analysis.toc is bad
348 INFO: Initializing module dependency graph...
351 INFO: Initializing module graph hooks...
430 INFO: running Analysis out00-Analysis.toc
431 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final 
executable
  required by c:\python27\python.exe
525 INFO: Found
...
...
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "c:\python27\lib\site-packages\PyInstaller\utils\win32\winutils.py", 
line 103, in import_pywin32_module
    name=module_name, globals={}, locals={}, fromlist=[''])
ImportError: No module named pywintypes
29585 INFO: Loading module hook "hook-setuptools.py"...
29631 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...
29634 INFO: Excluding import 'FixTk'
29635 INFO: Excluding import 'Tkinter'
29638 INFO: Loading module hook "hook-encodings.py"...
30174 INFO: Loading module hook "hook-reportlab.pdfbase._fontdata.py"...
30234 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
30236 INFO: Loading module hook "hook-numpy.core.py"...
30318 INFO: Loading module hook "hook-wx.lib.pubsub.py"...
30561 INFO: Loading module hook "hook-win32com.py"...
31109 INFO: Loading module hook "hook-pythoncom.py"...
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "c:\python27\lib\site-packages\PyInstaller\utils\win32\winutils.py", 
line 103, in import_pywin32_module
    name=module_name, globals={}, locals={}, fromlist=[''])
  File "c:\python27\lib\site-packages\pythoncom.py", line 2, in <module>
    import pywintypes
ImportError: No module named pywintypes
31572 INFO: Loading module hook "hook-reportlab.lib.utils.py"...
31630 INFO: Looking for ctypes DLLs
31723 INFO: Analyzing run-time hooks ...
31736 INFO: Including run-time hook 'pyi_rth__tkinter.py'
31739 INFO: Including run-time hook 'pyi_rth_pkgres.py'
31742 INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
31743 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
31773 INFO: Looking for dynamic libraries
Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
  File "C:\Python27\Scripts\pyinstaller.exe\__main__.py", line 9, in 
<module>
  File "c:\python27\lib\site-packages\PyInstaller\__main__.py", line 94, in 
run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\python27\lib\site-packages\PyInstaller\__main__.py", line 46, in 
run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\python27\lib\site-packages\PyInstaller\building\build_main.py", 
line 791, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), 
kw.get('clean_build'))
  File "c:\python27\lib\site-packages\PyInstaller\building\build_main.py", 
line 737, in build
    exec(text, spec_namespace)
  File "<string>", line 16, in <module>
  File "c:\python27\lib\site-packages\PyInstaller\building\build_main.py", 
line 213, in __init__
    self.__postinit__()
  File "c:\python27\lib\site-packages\PyInstaller\building\datastruct.py", 
line 161, in __postinit__
    self.assemble()
  File "c:\python27\lib\site-packages\PyInstaller\building\build_main.py", 
line 537, in assemble
    redirects=self.binding_redirects))
  File "c:\python27\lib\site-packages\PyInstaller\depend\bindepend.py", line 
222, in Dependencies
    for ftocnm, fn in getAssemblyFiles(pth, manifest, redirects):
  File "c:\python27\lib\site-packages\PyInstaller\depend\bindepend.py", line 
400, in getAssemblyFiles
    for assembly in getAssemblies(pth):
  File "c:\python27\lib\site-packages\PyInstaller\depend\bindepend.py", line 
351, in getAssemblies
    res = GetManifestResources(pth)
  File "c:\python27\lib\site-
packages\PyInstaller\utils\win32\winmanifest.py", line 1005, in 
GetManifestResources
    return winresource.GetResources(filename, [RT_MANIFEST], names, 
languages)
  File "c:\python27\lib\site-
packages\PyInstaller\utils\win32\winresource.py", line 168, in GetResources
    hsrc = win32api.LoadLibraryEx(filename, 0, LOAD_LIBRARY_AS_DATAFILE)
pywintypes.error: (1006, 'LoadLibraryEx', 'The volume for a file has been 
externally altered so that the opened file is no longer valid.')

1 Answers1

0

I have encountered the same issue. It was caused by Pyinstaller being very greedy when processing the files in the source directory, and as such it traversed and picked up things that were not suitable, e.g. subdirectories of frameworks, such as .git, or, in my case .vscode. This may results in some hard-to-debug issues - see https://stackoverflow.com/a/58195896/1603969.

I solved my problem by copying the source files to a clean directory and then producing a bundle from this clean directory where only necessary source files resided.

TimeS
  • 111
  • 2
  • 4