title: Pyinstaller .exe compilation error
body: <p>THE SOLUTION---> import Tkinter at top f script.</p>
  
  <p>I am trying to compile my python script (which uses matplotlib, pyside.pyqt, and numpy) into an exe using PyInstaller. After I compile it using this command:</p>
  
  <pre><code>py PyInstaller.py guidraw_final.py
  </code></pre>
  
  <p>I go ahead and run it from the directory it gets put into. However, I get this following error, which I don't understand.</p>
  
  <pre><code>PS C:\Users\Matthew\Desktop\pyinstaller-python3\guidraw_final\dist\guidraw_final&gt; ./guidraw_final.exe
  Qt: Untested Windows version 6.3 detected!
  Traceback (most recent call last):
    File "&lt;string&gt;", line 6, in &lt;module&gt;
    File "C:\Users\Matthew\Desktop\pyinstaller-python3\PyInstaller\loader\pyi_importers.py", line 308, in load_module
      exec(bytecode, module.__dict__)
    File "C:\Python34\lib\site-packages\matplotlib\pyplot.py", line 109, in &lt;module&gt;
      _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
    File "C:\Python34\lib\site-packages\matplotlib\backends\__init__.py", line 32, in pylab_setup
      globals(),locals(),[backend_name],0)
    File "C:\Users\Matthew\Desktop\pyinstaller-python3\PyInstaller\loader\pyi_importers.py", line 308, in load_module
      exec(bytecode, module.__dict__)
    File "C:\Python34\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 6, in &lt;module&gt;
      from six.moves import tkinter as Tk
    File "C:\Python34\lib\site-packages\six.py", line 90, in __get__
      result = self._resolve()
    File "C:\Python34\lib\site-packages\six.py", line 113, in _resolve
      return _import_module(self.mod)
    File "C:\Python34\lib\site-packages\six.py", line 80, in _import_module
      __import__(name)
  ImportError: No module named 'tkinter'
  </code></pre>
  
  <p>Next error---></p>
  
  <pre><code>PS C:\Users\Matthew\Desktop\pyinstaller-python3\guidraw_final\dist\guidraw_final&gt; ./guidraw_final
  Qt: Untested Windows version 6.3 detected!
  Traceback (most recent call last):
    File "&lt;string&gt;", line 6, in &lt;module&gt;
    File "&lt;frozen importlib._bootstrap&gt;", line 2237, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 2226, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 1191, in _load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 1161, in _load_backward_compatible
    File "C:\Users\Matthew\Desktop\pyinstaller-python3\PyInstaller\loader\pyi_importers.py", line 308, in load_module
      exec(bytecode, module.__dict__)
    File "C:\Python34\lib\site-packages\matplotlib\pyplot.py", line 109, in &lt;module&gt;
      _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
    File "C:\Python34\lib\site-packages\matplotlib\backends\__init__.py", line 32, in pylab_setup
      globals(),locals(),[backend_name],0)
    File "&lt;frozen importlib._bootstrap&gt;", line 2237, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 2226, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 1191, in _load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 1161, in _load_backward_compatible
    File "C:\Users\Matthew\Desktop\pyinstaller-python3\PyInstaller\loader\pyi_importers.py", line 308, in load_module
      exec(bytecode, module.__dict__)
    File "C:\Python34\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 6, in &lt;module&gt;
      from six.moves import tkinter as Tk
    File "&lt;frozen importlib._bootstrap&gt;", line 2281, in _handle_fromlist
    File "C:\Python34\lib\site-packages\six.py", line 90, in __get__
      result = self._resolve()
    File "C:\Python34\lib\site-packages\six.py", line 113, in _resolve
      return _import_module(self.mod)
    File "C:\Python34\lib\site-packages\six.py", line 80, in _import_module
      __import__(name)
    File "&lt;frozen importlib._bootstrap&gt;", line 2237, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 2226, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 1191, in _load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 1161, in _load_backward_compatible
    File "C:\Users\Matthew\Desktop\pyinstaller-python3\PyInstaller\loader\pyi_importers.py", line 308, in load_module
      exec(bytecode, module.__dict__)
    File "C:\Python34\lib\tkinter\__init__.py", line 36, in &lt;module&gt;
      from tkinter import _fix
    File "&lt;frozen importlib._bootstrap&gt;", line 2237, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 2226, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 1191, in _load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 1161, in _load_backward_compatible
    File "C:\Users\Matthew\Desktop\pyinstaller-python3\PyInstaller\loader\pyi_importers.py", line 308, in load_module
      exec(bytecode, module.__dict__)
    File "C:\Python34\lib\tkinter\_fix.py", line 65, in &lt;module&gt;
      import _tkinter
    File "&lt;frozen importlib._bootstrap&gt;", line 2237, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 2226, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 1191, in _load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 1161, in _load_backward_compatible
    File "C:\Users\Matthew\Desktop\pyinstaller-python3\PyInstaller\loader\pyi_importers.py", line 478, in load_module
      module = loader.load_module(fullname)
  UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: invalid character
  PS C:\Users\Matthew\Desktop\pyinstaller-python3\guidraw_final\dist\guidraw_final&gt;
  </code></pre>
  
  <p>Thanks for any guidance given. </p>