Having issues running pyinstaller on a little script&gui I made. Works fine when run as a script. I am not really sure what else to try and don't understand the nature of hooks. If there isn't an easy solution is there a workaround I could try?
Here's the dependencies in the code:
import os
import shutil
import sys
import math
import openpyxl
from datetime import datetime
from docx import Document
from docx.shared import Inches
from docx.oxml.table import CT_Tbl
from docx.oxml.text.paragraph import CT_P
from docx.table import Table
import PySimpleGUI as sg
import traceback
Here's what happens when I try to run pyinstaller:
(base) C:\Users\cnelson>pyinstaller --onefile -w C:\Users\cnelson\.spyder-py3\CSandSOWCreationRev001.py
2154 INFO: PyInstaller: 4.2
2154 INFO: Python: 3.8.5 (conda)
2155 INFO: Platform: Windows-10-10.0.17763-SP0
2157 INFO: wrote C:\Users\cnelson\CSandSOWCreationRev001.spec
2163 INFO: UPX is not available.
2165 INFO: Extending PYTHONPATH with paths
['C:\\Users\\cnelson\\.spyder-py3', 'C:\\Users\\cnelson']
2300 INFO: checking Analysis
2300 INFO: Building Analysis because Analysis-00.toc is non existent
2301 INFO: Initializing module dependency graph...
2321 INFO: Caching module graph hooks...
2350 WARNING: Several hooks defined for module 'win32ctypes.core'. Please take care they do not conflict.
2374 INFO: Analyzing base_library.zip ...
11386 INFO: Processing pre-find module path hook distutils from 'c:\\users\\cnelson\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
11391 INFO: distutils: retargeting to non-venv dir 'c:\\users\\cnelson\\anaconda3\\lib'
18206 INFO: Caching module dependency graph...
18374 INFO: running Analysis Analysis-00.toc
18398 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\cnelson\anaconda3\python.exe
18780 INFO: Analyzing C:\Users\cnelson\.spyder-py3\CSandSOWCreationRev001.py
24790 INFO: Processing pre-find module path hook site from 'c:\\users\\cnelson\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-site.py'.
24794 INFO: site: retargeting to fake-dir 'c:\\users\\cnelson\\anaconda3\\lib\\site-packages\\PyInstaller\\fake-modules'
28539 INFO: Processing pre-safe import module hook setuptools.extern.six.moves from 'c:\\users\\cnelson\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-setuptools.extern.six.moves.py'.
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "C:\Users\cnelson\.spyder-py3\setuptools\__init__.py", line 16, in <module>
import setuptools.version
File "C:\Users\cnelson\.spyder-py3\setuptools\version.py", line 1, in <module>
import pkg_resources
File "C:\Users\cnelson\.spyder-py3\pkg_resources\__init__.py", line 78, in <module>
from pkg_resources.extern import appdirs
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
File "C:\Users\cnelson\.spyder-py3\pkg_resources\extern\__init__.py", line 43, in load_module
__import__(extant)
File "C:\Users\cnelson\.spyder-py3\pkg_resources\_vendor\appdirs.py", line 560, in <module>
import win32com.shell
File "C:\Users\cnelson\.spyder-py3\win32com\__init__.py", line 93, in <module>
__gen_path__ = iter(sys.modules["win32com.gen_py"].__path__).next()
AttributeError: 'list_iterator' object has no attribute 'next'
pre-safe-import-module hook failed, needs fixing.