title: converting .py to .exe using Python 3.5/3.6?
body: <p>I created an application in Python 3.6 with a GUI built in PyQt5. Some modules are only available for Python 3.5 and 3.6.
  I managed to pack it on Mac using py2app. I am trying to do the same thing on Windows. I tried to use <a href="https://stackoverflow.com/questions/41570359/best-method-of-converting-py-to-exe-for-python-3-6">this guide</a>, but I still have issues.
  For what I understand I have 3 options:</p>
  
  <ol>
  <li>py2exe</li>
  <li>pyinstaller</li>
  <li>cx_Freeze</li>
  </ol>
  
  <p><strong>1) py2exe</strong></p>
  
  <p>According to <a href="https://stackoverflow.com/questions/41578808/python-indexerror-tuple-index-out-of-range-when-using-py2exe">here</a> py2exe is still not available for python3.6, I need to use python3.5 then.</p>
  
  <p>Using 3.5, I get this error and the compilation stops:</p>
  
  <pre><code>error: [Errno 2] No such file or directory: 'C:\\Users\\carlo\\AppData\\Roaming\\Python\\Python35\\site-packages\\py2exe\\run-py3.5-win32.exe'
  </code></pre>
  
  <p><strong>2) pyinstaller</strong>
  Running pyinstaller through Python3.5 as:
  <code>pyinstaller --onefile APP.py</code></p>
  
  <p>I get just a bunch of warnings (lib not found) but the compilation gets to the end. The created EXE, though, opens the command prompt and pops up the following error:</p>
  
  <pre><code>   Traceback (most recent call last):
    File "site-packages\PyInstaller\loader\rthooks\pyi_rth_qt5plugins.py", line 46, in &lt;module&gt;
    File "c:\program files (x86)\python35-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 573, in load_module
      module = loader.load_module(fullname)
  ImportError: DLL load failed: %1 is not a valid Win32 application.
  Failed to execute script pyi_rth_qt5plugins
  </code></pre>
  
  <p><strong>3) cx_Freeze</strong>
  Using python3.5, it first give the 'TCL_LIBRARY' error. Following the instructions <a href="https://stackoverflow.com/questions/35533803/keyerror-tcl-library-when-i-use-cx-freeze">here</a> the compilation goes smoothly. The created application, however, opens up and closes immediately. It simply doesn't work.
  Using python3.6, the compilation seems okay. When I try to open the application, this error pops up. I just managed to take a quick <a href="https://i.stack.imgur.com/7etnA.png" rel="nofollow noreferrer">screen-shot:</a></p>
  
  <p>Does anybody have any suggestion? Any alternative I am not considering?</p>