[TxMt] Re: using python 3.0.1

Christian maillists at gmx.de
Sun Mar 15 13:07:31 UTC 2009


Hi Andrei,

first of all thanks a lot for the great to you and of course to the  
others too! LaTeX typesetting runs fine again... puuh, but

Am 15.03.2009 um 10:33 schrieb Andrei Maxim:

> Christian,
>
> I just took a closer look at the "Update Shell Profile.command"  
> script that you were supposed to run and I noticed that if you don't  
> have ~/.bash_profile, ~/.bash_login or ~/.profile the script will  
> create ~/.bash_profile.
>
> In case you didn't know, "~/.bash_profile" is the file called  
> ".bash_profile" (notice the leading dot) in your home directory  
> (i.e. "/Users/christian/" if you short username is christian).
>
> If you open that file you should see at least these lines, probably  
> at the end of the file:
>
> # Setting PATH for MacPython 3.0
> # The orginal version is saved in .bash_login.pysave
> PATH="/Library/Frameworks/Python.framework/Versions/3.0/bin:${PATH}"
> export PATH
>
> These lines will place the Python 3.0 executable files before the  
> default executable files and when you'll run "python -V" Bash will  
> run the python executable in the Python 3.0 folder because there's  
> the first match. The same thing happens when running "/usr/bin/env  
> python".
>
> You need to change the search order because most scripts are  
> expecting Python 2.x, not 3.0 (and probably the LaTeX bundle  
> requires Python 2.x). So you need to change the third line to:
>
> PATH="${PATH}:/Library/Frameworks/Python.framework/Versions/3.0/bin"
>
> What you're doing is changing the search order so Bash will run /usr/ 
> bin/python first, which is version 2.5.1. You'll need to use /usr/ 
> bin/env python3.0 in your scripts' shebang line to make sure your  
> code is running 3.0.
>
> I hope this clears things up.

You explained it very well and now I have some clue about that stuff  
works.
In my case a .profile file was created and I changed the line as you  
suggested. Afterwards I cleared all "PATH" variables from TextMate and  
logged out and in again.

Now terminal says 2.5.1 when typing

python -V

When I start TM, open my project and type cmd+R for typesetting, I get  
the following info:

The current PATH is:

/usr/bin
/bin
/usr/sbin
/sbin
Please add the directory containing “kpsewhich” to PATH in TextMate's  
Shell Variables preferences.

Alternatively, the PATH can be retrieved from Terminal but this  
requires a relaunch: Set PATH and Relaunch.

After I pressed "Set PATH and Relaunch" the shell variable for PATH is  
set to

/sw/bin:/sw/sbin:/sw/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/ 
usr/texbin:/usr/X11/bin:/usr/X11R6/bin:/Library/Frameworks/ 
Python.framework/Versions/3.0/bin

Is that fine or should it be included in .profile as well?

Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20090315/fe6dbdc6/attachment.html>


More information about the textmate mailing list