title: py2app Tkinter.pyc linking outside of app bundle
body: <p>I am trying to learn how to use py2app following the Sandwich.app tutorial (<a href="https://www.metachris.com/2015/11/create-standalone-mac-os-x-applications-with-python-and-py2app/" rel="nofollow noreferrer">1</a>).  I am using python2.7.11 installed from MacPorts along with py2app 0.9.1, also installed from MacPorts.</p>
  <p>Running <code>python setup.py py2app</code> produces an app bundle that appears to work. However, if I &quot;remove&quot; my /opt/local directory (<code>sudo mv /opt/local /opt/local-save</code>), I find that the app depends on having files within my MacPorts install, specifically Tkinter.pyc tries to find tcl8.6 outside of the bundle:</p>
  <blockquote>
  <p>6/5/16 9:08:02.561 AM Sandwich[79618]:   File &quot;/Users/gbarnes/bin/sandwichApp/Sandwich.app/Contents/Resources/<strong>boot</strong>.py&quot;, line 351, in </p>
  <p>6/5/16 9:08:02.561 AM Sandwich[79618]:     _run()</p>
  <p>6/5/16 9:08:02.561 AM Sandwich[79618]:   File &quot;/Users/gbarnes/bin/sandwichApp/Sandwich.app/Contents/Resources/<strong>boot</strong>.py&quot;, line 336, in _run</p>
  <p>6/5/16 9:08:02.561 AM Sandwich[79618]:     exec(compile(source, path, 'exec'), globals(), globals())</p>
  <p>6/5/16 9:08:02.561 AM Sandwich[79618]:   File &quot;/Users/gbarnes/bin/sandwichApp/Sandwich.app/Contents/Resources/Sandwich.py&quot;, line 8, in </p>
  <p>6/5/16 9:08:02.561 AM Sandwich[79618]:     root = tk.Tk()</p>
  <p>6/5/16 9:08:02.561 AM Sandwich[79618]:   File &quot;Tkinter.pyc&quot;, line 1814, in <strong>init</strong></p>
  <p>6/5/16 9:08:02.561 AM Sandwich[79618]: _tkinter.TclError: Can't find a usable init.tcl in the following directories:</p>
  <p>6/5/16 9:08:02.561 AM Sandwich[79618]:     /opt/local/lib/tcl8.6 /Users/gbarnes/bin/sandwichApp/Sandwich.app/Contents/lib/tcl8.6 /Users/gbarnes/bin/sandwichApp/Sandwich.app/lib/tcl8.6 /Users/gbarnes/bin/sandwichApp/Sandwich.app/Contents/library /Users/gbarnes/bin/sandwichApp/Sandwich.app/library /Users/gbarnes/bin/sandwichApp/Sandwich.app/tcl8.6.4/library /Users/gbarnes/bin/sandwichApp/tcl8.6.4/library</p>
  <p>6/5/16 9:08:02.562 AM Sandwich[79618]: This probably means that Tcl wasn't installed properly.</p>
  </blockquote>
  <p>Simply copying /opt/local/lib/tcl8.6 into one of the &quot;following directories&quot; results in additional problems (needing to copy tk8.6 into the same location followed by the app crashing with what appears to be fontconfig errors).</p>
  <p>I feel that there must be something simple that I am missing and any help/suggestions would be greatly appreciated.</p>