title: Pyinstaller - ImportError: Module 'pythoncom' isn't in frozen sys.path
body: <p>after trying running exe built by pyinstaller I've recived that message:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_win32comgenpy.py&quot;, line 40, in &lt;module&gt;
    File &quot;PyInstaller\loader\pyimod03_importers.py&quot;, line 476, in exec_module
    File &quot;win32com\__init__.py&quot;, line 6, in &lt;module&gt;
    File &quot;PyInstaller\loader\pyimod03_importers.py&quot;, line 476, in exec_module
    File &quot;pythoncom.py&quot;, line 4, in &lt;module&gt;
    File &quot;pywintypes.py&quot;, line 44, in __import_pywin32_system_module__
  ImportError: Module 'pythoncom' isn't in frozen sys.path ['C:\\Users\\KONRAD~1.DZI\\AppData\\Local\\Temp\\_MEI23842\\base_library.zip', 'C:\\Users\\KONRAD~1.DZI\\AppData\\Local\\Temp\\_MEI23842\\lib-dynload', 'C:\\Users\\KONRAD~1.DZI\\AppData\\Local\\Temp\\_MEI23842']
  [11136] Failed to execute script 'pyi_rth_win32comgenpy' due to unhandled exception!
  </code></pre>
  <p>I've tried to built exe file with hidden-import of win32com module and without and that won't work anyways. Also I've reinstall win32com but that also don't helped.</p>
  <p><code>pyinstaller --onefile --hidden-import win32com  main.py</code></p>
  <p>After removing <code>import win32com.client</code> and removing this part:</p>
  <pre><code>if mail.lower() == 'tak':
     outlook = win32.Dispatch('outlook.application')
     mail = outlook.CreateItem(0)
  
     mail.To = dane['email']
  
     mail.Subject = dane['temat']
  
     if dane['zawartość'].lower() == 'brak':
        mail.Body = ''
  
     else:
        mail.Body = dane['zawartość']
     email_cc = &quot;&quot;
     cc_list = dane['cc']
     if cc_list[0].lower() == &quot;brak&quot;:
        pass
     else:
        for email in dane['cc']:
           email_cc = email_cc + email + ';'
  
     for file in os.listdir(rozdzielone_pliki + '\\'):
        file_location = rozdzielone_pliki + '\\' + file
        mail.Attachments.Add(file_location)
  
     mail.Send()#
  </code></pre>
  <p>Everything works fine.</p>
  <p>What should I do?
  Thanks for help.</p>