title: Pyinstaller + Tkinter + Mac OS + TCL
body: <p>So I am trying to run compile into binary a very simple Python code using Tkinter. Here is the code for test1.py:</p>
  
  <pre><code>import Tkinter as tk
  
  counter = 0
  def counter_label(label):
    counter = 0
    def count():
      global counter
      counter += 1
      label.config(text=str(counter))
      label.after(1000, count)
    count()
  
  
  root = tk.Tk()
  root.title("Counting Seconds")
  label = tk.Label(root, fg="dark green")
  label.pack()
  counter_label(label)
  button = tk.Button(root, text='Stop', width=25, command=root.destroy)
  button.pack()
  root.mainloop()
  </code></pre>
  
  <p>I then used <code>pyinstaller</code> to compile by running the following:</p>
  
  <pre><code>pyinstaller --onedir --windowed test1.py
  </code></pre>
  
  <p>This runs fine and generates 2 files as expected (Unix's version of .exe and app). When I click on app file, it crashes as it starts - I don't see anything. If I click on the other file (.exe) style - it opens a new terminal window and eventually I get the following error message:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "/private/var/folders/0t/1b6bbpcj52xdthkg2d6g2sr40000gn/T/pip-install-MgS374/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 389, in load_module
    File "lib-tk/Tkinter.py", line 39, in &lt;module&gt;
    File "/private/var/folders/0t/1b6bbpcj52xdthkg2d6g2sr40000gn/T/pip-install-MgS374/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 546, in load_module
  ImportError: dlopen(/var/folders/0t/1b6bbpcj52xdthkg2d6g2sr40000gn/T/_MEIJX4TS8/_tkinter.so, 2): Library not loaded: @loader_path/Tcl
    Referenced from: /var/folders/0t/1b6bbpcj52xdthkg2d6g2sr40000gn/T/_MEIJX4TS8/_tkinter.so
    Reason: no suitable image found.  Did find:
      /var/folders/0t/1b6bbpcj52xdthkg2d6g2sr40000gn/T/_MEIJX4TS8/Tcl: not a file
      /private/var/folders/0t/1b6bbpcj52xdthkg2d6g2sr40000gn/T/_MEIJX4TS8/Tcl: not a file
  test1 returned -1
  logout
  Saving session...
  ...copying shared history...
  ...saving history...truncating history files...
  ...completed.
  
  [Process completed]
  </code></pre>
  
  <p>What can I do to fix this? I think its something to do with TCL installation on Mac OS's version of Python. I saw different potential solutions on the web, but unfortunately none of them worked. Any help would be much appreciated.</p>