title: pyinstaller exe freezes when using "from PyQt5 import uic"
body: <p>I am trying to use python to launch Adobe photoshop and run a script inside photoshop.
  Below is my code. It works when I run from the windows command line using python 3.9.1 <br><br>
  If I use pyinstaller to make an exe using <code>pyinstaller Photoshop.py</code> ,then run the created .exe. Photoshop is started and script begins to run and then the process freezes. <br><br>
  If I comment out the second line in the below code <code># from PyQt5 import uic</code> then run pyinstaller again the resulting .exe that is created has no problems and runs as if I ran it using python from the command line. <br>
  <br>
  Any ideas why importing uic from PyQt5 would mess up pyinstaller in some way?
  <br>
  <br>
  I realize im importing UIC and not using it. This problem is part of a larger project where the module is used. I have just created a small example here to get help with my problem.</p>
  <pre><code>import subprocess
  from PyQt5 import uic
  
  class Photoshop2021:
      def __init__(self):
          print(&quot;Created&quot;)
  
      def runBenchmark(self):
          cmd = [r&quot;C:\Program Files\Adobe\Adobe Photoshop 2021\Photoshop.exe&quot;,
                 r&quot;C:\Program Files\Adobe\Adobe Photoshop 2021\Presets\Scripts\TCL Photoshop Benchmark_AUTO 2.3.jsxbin&quot;]
  
          subprocess.call(cmd, shell=True)
  
  Photoshop2021().runBenchmark()
  </code></pre>
  <p>Here is the output of pyinstaller when the import statement is uncommented and the photoshop process freezes.</p>
  <pre><code>C:\Users\Z8G4\Desktop\Automation-Sidekick\build\Temp&gt;pyinstaller --noconfirm PhotoshopTest.py
  55 INFO: PyInstaller: 4.4
  55 INFO: Python: 3.9.1
  58 INFO: Platform: Windows-10-10.0.19041-SP0
  61 INFO: wrote C:\Users\Z8G4\Desktop\Automation-Sidekick\build\Temp\PhotoshopTest.spec
  64 INFO: UPX is not available.
  66 INFO: Extending PYTHONPATH with paths
  ['C:\\Users\\Z8G4\\Desktop\\Automation-Sidekick\\build\\Temp',
   'C:\\Users\\Z8G4\\Desktop\\Automation-Sidekick\\build\\Temp']
  73 INFO: checking Analysis
  74 INFO: Building Analysis because Analysis-00.toc is non existent
  74 INFO: Initializing module dependency graph...
  79 INFO: Caching module graph hooks...
  87 WARNING: Several hooks defined for module 'win32ctypes.core'. Please take care they do not conflict.
  90 INFO: Analyzing base_library.zip ...
  2083 INFO: Processing pre-find module path hook distutils from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
  2084 INFO: distutils: retargeting to non-venv dir 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib'
  3632 INFO: Caching module dependency graph...
  3783 INFO: running Analysis Analysis-00.toc
  3785 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
    required by c:\users\z8g4\appdata\local\programs\python\python39\python.exe
  3840 WARNING: lib not found: api-ms-win-core-path-l1-1-0.dll dependency of c:\users\z8g4\appdata\local\programs\python\python39\python39.dll
  3857 INFO: Analyzing C:\Users\Z8G4\Desktop\Automation-Sidekick\build\Temp\PhotoshopTest.py
  3925 INFO: Processing pre-find module path hook PyQt5.uic.port_v2 from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-PyQt5.uic.port_v2.py'.
  3989 INFO: Processing module hooks...
  3990 INFO: Loading module hook 'hook-difflib.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  3993 INFO: Loading module hook 'hook-distutils.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  3995 INFO: Loading module hook 'hook-distutils.util.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  3996 INFO: Loading module hook 'hook-encodings.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  4075 INFO: Loading module hook 'hook-heapq.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  4076 INFO: Loading module hook 'hook-lib2to3.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  4110 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  4111 INFO: Loading module hook 'hook-pickle.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  4113 INFO: Loading module hook 'hook-PyQt5.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  4268 WARNING: Hidden import &quot;sip&quot; not found!
  4269 INFO: Loading module hook 'hook-PyQt5.QtCore.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  4332 INFO: Loading module hook 'hook-PyQt5.QtGui.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  4457 INFO: Loading module hook 'hook-PyQt5.QtWidgets.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  4719 INFO: Loading module hook 'hook-PyQt5.uic.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  4723 INFO: Loading module hook 'hook-sysconfig.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  4724 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  4725 INFO: Loading module hook 'hook-xml.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  4764 INFO: Loading module hook 'hook-_tkinter.py' from 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
  4872 INFO: checking Tree
  4872 INFO: Building Tree because Tree-00.toc is non existent
  4874 INFO: Building Tree Tree-00.toc
  4924 INFO: checking Tree
  4925 INFO: Building Tree because Tree-01.toc is non existent
  4926 INFO: Building Tree Tree-01.toc
  4996 INFO: checking Tree
  4997 INFO: Building Tree because Tree-02.toc is non existent
  4999 INFO: Building Tree Tree-02.toc
  5019 INFO: Looking for ctypes DLLs
  5033 INFO: Analyzing run-time hooks ...
  5035 INFO: Including run-time hook 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgutil.py'
  5037 INFO: Including run-time hook 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py'
  5044 INFO: Including run-time hook 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py'
  5045 INFO: Including run-time hook 'c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pyqt5.py'
  5052 INFO: Looking for dynamic libraries
  5938 INFO: Looking for eggs
  5938 INFO: Using Python library c:\users\z8g4\appdata\local\programs\python\python39\python39.dll
  5940 INFO: Found binding redirects:
  []
  5946 INFO: Warnings written to C:\Users\Z8G4\Desktop\Automation-Sidekick\build\Temp\build\PhotoshopTest\warn-PhotoshopTest.txt
  5983 INFO: Graph cross-reference written to C:\Users\Z8G4\Desktop\Automation-Sidekick\build\Temp\build\PhotoshopTest\xref-PhotoshopTest.html
  5994 INFO: checking PYZ
  5994 INFO: Building PYZ because PYZ-00.toc is non existent
  5995 INFO: Building PYZ (ZlibArchive) C:\Users\Z8G4\Desktop\Automation-Sidekick\build\Temp\build\PhotoshopTest\PYZ-00.pyz
  6449 INFO: Building PYZ (ZlibArchive) C:\Users\Z8G4\Desktop\Automation-Sidekick\build\Temp\build\PhotoshopTest\PYZ-00.pyz completed successfully.
  6460 INFO: checking PKG
  6460 INFO: Building PKG because PKG-00.toc is non existent
  6461 INFO: Building PKG (CArchive) PKG-00.pkg
  6478 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
  6479 INFO: Bootloader c:\users\z8g4\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
  6479 INFO: checking EXE
  6480 INFO: Building EXE because EXE-00.toc is non existent
  6483 INFO: Building EXE from EXE-00.toc
  6485 INFO: Copying icons from ['c:\\users\\z8g4\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\bootloader\\images\\icon-console.ico']
  6486 INFO: Writing RT_GROUP_ICON 0 resource with 104 bytes
  6486 INFO: Writing RT_ICON 1 resource with 3752 bytes
  6487 INFO: Writing RT_ICON 2 resource with 2216 bytes
  6487 INFO: Writing RT_ICON 3 resource with 1384 bytes
  6490 INFO: Writing RT_ICON 4 resource with 37019 bytes
  6491 INFO: Writing RT_ICON 5 resource with 9640 bytes
  6495 INFO: Writing RT_ICON 6 resource with 4264 bytes
  6498 INFO: Writing RT_ICON 7 resource with 1128 bytes
  6501 INFO: Appending archive to EXE C:\Users\Z8G4\Desktop\Automation-Sidekick\build\Temp\build\PhotoshopTest\PhotoshopTest.exe
  6830 INFO: Building EXE from EXE-00.toc completed successfully.
  6833 INFO: checking COLLECT
  6833 INFO: Building COLLECT because COLLECT-00.toc is non existent
  6835 INFO: Building COLLECT COLLECT-00.toc
  7267 INFO: Building COLLECT COLLECT-00.toc completed successfully.
  </code></pre>