title: AttributeError: Module 'PyQt5' has no attribute '__version__'
body: <p>I was trying to warp a python file to an .exe file. But with these two lines, I encountered this problem.</p>
  <pre><code>import cv2
  exit()
  </code></pre>
  <pre><code>Traceback (most recent call last):
    File &quot;d:\anaconda3\lib\runpy.py&quot;, line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File &quot;d:\anaconda3\lib\runpy.py&quot;, line 87, in _run_code
      exec(code, run_globals)
    File &quot;D:\Anaconda3\Scripts\pyinstaller.exe\__main__.py&quot;, line 7, in &lt;module&gt;
    File &quot;d:\anaconda3\lib\site-packages\PyInstaller\__main__.py&quot;, line 114, in run
      run_build(pyi_config, spec_file, **vars(args))
    File &quot;d:\anaconda3\lib\site-packages\PyInstaller\__main__.py&quot;, line 65, in run_build
      PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
    File &quot;d:\anaconda3\lib\site-packages\PyInstaller\building\build_main.py&quot;, line 758, in main
      build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
    File &quot;d:\anaconda3\lib\site-packages\PyInstaller\building\build_main.py&quot;, line 705, in build
      exec(code, spec_namespace)
    File &quot;D:\solar_cell\main.spec&quot;, line 7, in &lt;module&gt;
      a = Analysis(['main.py'],
    File &quot;d:\anaconda3\lib\site-packages\PyInstaller\building\build_main.py&quot;, line 254, in __init__
      self.__postinit__()
    File &quot;d:\anaconda3\lib\site-packages\PyInstaller\building\datastruct.py&quot;, line 159, in __postinit__
      self.assemble()
    File &quot;d:\anaconda3\lib\site-packages\PyInstaller\building\build_main.py&quot;, line 433, in assemble
      self.graph.process_post_graph_hooks(self)
    File &quot;d:\anaconda3\lib\site-packages\PyInstaller\depend\analysis.py&quot;, line 373, in process_post_graph_hooks
      module_hook.post_graph(analysis)
    File &quot;d:\anaconda3\lib\site-packages\PyInstaller\depend\imphook.py&quot;, line 451, in post_graph
      self._load_hook_module()
    File &quot;d:\anaconda3\lib\site-packages\PyInstaller\depend\imphook.py&quot;, line 408, in _load_hook_module
      self._hook_module = importlib_load_source(
    File &quot;d:\anaconda3\lib\site-packages\PyInstaller\compat.py&quot;, line 637, in importlib_load_source
      return mod_loader.load_module()
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 522, in _check_name_wrapper
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 1027, in load_module
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 852, in load_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 265, in _load_module_shim
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 702, in _load
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 671, in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 848, in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 219, in _call_with_frames_removed
    File &quot;d:\anaconda3\lib\site-packages\PyInstaller\hooks\hook-PyQt5.py&quot;, line 14, in &lt;module&gt;
      from PyInstaller.utils.hooks.qt import pyqt5_library_info, get_qt_binaries
    File &quot;d:\anaconda3\lib\site-packages\PyInstaller\utils\hooks\qt.py&quot;, line 122, in &lt;module&gt;
      pyqt5_library_info = Qt5LibraryInfo('PyQt5')
    File &quot;d:\anaconda3\lib\site-packages\PyInstaller\utils\hooks\qt.py&quot;, line 50, in __init__
      if hooks.is_module_satisfies(&quot;PyQt5 &gt;= 5.15.4&quot;):
    File &quot;d:\anaconda3\lib\site-packages\PyInstaller\utils\hooks\__init__.py&quot;, line 533, in is_module_satisfies
      version = get_module_attribute(module_name, version_attr)
    File &quot;d:\anaconda3\lib\site-packages\PyInstaller\utils\hooks\__init__.py&quot;, line 329, in get_module_attribute
      raise AttributeError(
  AttributeError: Module 'PyQt5' has no attribute '__version__'
  </code></pre>
  <p>If I just print something like: <code>print('dsfdsfs')</code>, then it can be wrapped to an .exe successfully.</p>
  <p>My environment:<br />
  win10<br />
  pyinstaller     5.0.dev0<br />
  opencv-python   4.5.2.54<br />
  pyqt            5.9.2</p>
  <p>And I was using anaconda prompt to do so.</p>