title: Pyinstaller --onefile ImportError: No module named 'win32api'
body: <p><strong>Problem statement:</strong></p>
  
  <p>I can't seem to run </p>
  
  <pre><code>'PyInstaller --onefile myfile.py'
  </code></pre>
  
  <p>on a file containing</p>
  
  <pre><code>import wmi
  </code></pre>
  
  <p>It cannot find win32api. I get a popup warning saying python has stopped etc. My console says "ImportError: No module named 'win32api'". I can run 'import win32api', 'import win32com', and 'import WMI' in python directly in the same environment without issue. I fundamentally don't understand what is wrong here.</p>
  
  <p><strong>Error message:</strong></p>
  
  <pre><code>3469 INFO: Loading module hook "hook-pywintypes.py"...
  Fatal Python error: Py_Initialize: can't initialize sys standard streams
  ImportError: No module named 'win32api'
  </code></pre>
  
  <p><strong>I have tried:</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/11421448/pyinstaller-importerror-no-module-named-win32api">PyInstaller - ImportError: No module named win32api</a> - 'import os' works fine for PyInstaller and runs fine in python.</p>
  
  <p><a href="https://stackoverflow.com/questions/25314463/no-module-named-win32api">No module named 'win32api'</a> - Not very helpful</p>
  
  <p><a href="https://stackoverflow.com/questions/4863056/how-to-install-pywin32-module-in-windows-7/17061853#17061853">How to install pywin32 module in windows 7</a> - This is where I got the SF link (python3.5 amd64 pywin32 version)</p>
  
  <p><a href="https://stackoverflow.com/questions/21343774/importerror-no-module-named-win32api">ImportError: no module named win32api</a> -
   I thought it might be a path thing, but my installation <em>appears</em> to be in the correct place: "C:\Users\myuser\AppData\Local\Continuum\Anaconda3\pkgs\pywin32-220-py35_2\Lib\site-packages\win32"</p>
  
  <p>I can run 'PyInstaller --onefile myscript.py' on other files, and have without issue as long as they don't use the wmi module.</p>
  
  <p>I looked at the win32com _init__.py line 5 where it's messing up and it's just an import statement for win32api.</p>
  
  <p><strong>System:</strong></p>
  
  <p>Windows 7 x64, Python 3.5.3 64bit, Anaconda 4.3.14 64bit, using pyinstaller 3.2.3 (recommended by <a href="https://stackoverflow.com/questions/39728108/running-pyinstaller-after-anaconda-install-results-in-importerror-no-module-nam">this thread</a>), with pywin32 220 (with sourceforge download [I know, I tried pip, conda, and easy_install]) and I'm running it in cmder as an admin.</p>