[Tkinter-discuss] Installing Tk.framework to directory other than system directories

Russell E. Owen rowen at cesmail.net
Tue Feb 20 20:36:27 CET 2007

In article <52782. at webmail.nmt.edu>,
 jstradli at nmt.edu wrote:

> Hello,
> Platform: Mac OS X 10.4
> I'm trying to install the Tk.framework to a directory other than
> /Library/Frameworks or /System/Library/Frameworks or ~/Library/Frameworks
> .  I'm wanting to do this so I can create Mac packages with a custom build
> of Python, Tkinter and some additional modules that can be installed in a
> completely self contained custom directory.  I don't want Tk.framework to
> be installed to the system directories because it may inadvertently
> clobber a users Tk.framework ;-).
> Here is what I have done
> 1) Built tcl with framework enabled and custom prefix.
>    Then I changed the path the framework was to be
>    installed to in the Makefile
>    (namely /opt/<somename>/Library/Frameworks)
> 2) I then repeated the above for tk
> 3) I configured python with a custom prefix,
>    then I edited setup.py and added to the
>    beginning of the list variable "framework_dirs"
>    the path to my tk and tcl frameworks
>    (/opt/<somename>/Library/Frameworks)
>    I than ran make and make install
> After testing this I noticed that it was still linking to the
> MAC OS default Tk.framework in /System/Library/Frameworks not
> my newly installed framework?
> Sorry for the long-windedness I wanted to make it clear what
> I have done and my end goal.

Could you just use py2app to package your application? It handles all 
this for you. Your own special Python, Tcl and Tk will be included in 
the resulting application (making it rather large) and the user's own 
Python, Tcl and Tk will be ignored -- but just for that one application.

-- Russell

More information about the Tkinter-discuss mailing list