My install is pretty much vanilla Python 3.0.1. All I changed was the line added to ~/.bash_login by the Python installer. Notice that ${PATH} is before the path to the Python 3.0.1 binary files:<div><br></div><div><div># Setting PATH for MacPython 3.0</div>
<div># The orginal version is saved in .bash_login.pysave</div><div>PATH="${PATH}:/Library/Frameworks/Python.framework/Versions/3.0/bin"</div><div>export PATH</div><div><br></div><div>When running this tiny program I get the expected output:</div>
<div><br></div><div><div>#!/usr/bin/env python3.0</div><div>print ("hallo world")</div></div><div><br></div><div>It really doesn't matter if you use Python 3 as the default version of Python or not, so there must be something that you changed. AFAIK, the only change that you really needed to do is either run the command file from the Python 3.0 folder or add those 4 lines in the .bash_login file (or whatever shell you use).</div>
<br>Andrei Maxim<br><a href="http://artfulco.de">http://artfulco.de</a><br>
<br><br><div class="gmail_quote">On Sat, Mar 14, 2009 at 10:04 AM, Christian <span dir="ltr"><<a href="mailto:maillists@gmx.de">maillists@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">Thanks for helping me out.<div><br></div><div>Now TM also uses v3.0.1. But when I use cmd+R the following error message appears with the output:</div><div><br></div><div><div>Error in sitecustomize; set PYTHONVERBOSE for traceback:</div>
<div>NameError: name 'reload' is not defined</div><div>hallo world</div><div><br></div><div>How could this be corrected?</div><div><br></div><div>Thanks</div><div>Christian</div></div><div><br></div><div><br><div>
<div>Am 13.03.2009 um 22:14 schrieb Andrei Maxim:</div><div><div></div><div class="h5"><br><blockquote type="cite">Since I wanted to try out Python anyway, I downloaded the latest Mac package (3.0.1 to be precise) and installed it on my computer. At the beginning, `python -V` kept saying it's version 2.5.1 and I couldn't find any executable called `python3.0` as mentioned above.<div>
 <br></div><div>The trick is to run the "Update Shell Profile.command" file that was installed in the /Applications/Python 3.0 folder. It will update your ~/.bash_login so your $PATH will contain "/Library/Frameworks/Python.framework/Versions/3.0".</div>
 <div><br></div><div>Obviously, `python -V` will always say `3.0.1` from now on so you might want to add it at the end of the path (or at least after /usr/bin/). After that, here's what I got:</div><div><br></div><div>
 <div><font face="'courier new', monospace">#!/usr/bin/env python</font></div><div><font face="'courier new', monospace">import sys</font></div><div><font face="'courier new', monospace"><br> </font></div>
<div><font face="'courier new', monospace">print(sys.version) #=> 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)</font></div><div><br></div><div>and</div><div><br></div><div><div> <font face="'courier new', monospace">#!/usr/bin/env python3.0</font></div>
<div><font face="'courier new', monospace">import sys</font></div><div><font face="'courier new', monospace"><br> </font></div><div><font face="'courier new', monospace">print(sys.version) #=> 3.0.1 (r301:69597, Feb 14 2009, 19:03:52)</font> </div>
</div></div><div><br>Hope that helps.</div><div><br> </div><div>Andrei Maxim<br><a href="http://artfulco.de" target="_blank">http://artfulco.de</a><br> <br><br><div class="gmail_quote">On Fri, Mar 13, 2009 at 10:46 PM, Alex Ross <span dir="ltr"><<a href="mailto:tm-alex@rosiba.com" target="_blank">tm-alex@rosiba.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <div><div></div><div><br> On Mar 13, 2009, at 1:40 PM, Christian wrote:<br> <br> ><br> > Am 13.03.2009 um 21:34 schrieb Peter Cowan:<br>
 ><br> >> On Fri, Mar 13, 2009 at 1:27 PM, Christian <<a href="mailto:maillists@gmx.de" target="_blank">maillists@gmx.de</a>> wrote:<br> >>><br> >>> Am 13.03.2009 um 21:12 schrieb Alex Ross:<br>
 >>><br> >>>> On Mar 13, 2009, at 12:59 PM, Rob McBroom wrote:<br> >>>><br> >>>>> On 2009-Mar-13, at 2:15 PM, Christian wrote:<br> >>>>><br> >>>>>> But I would like to use Python v3 within TextMate when pressing<br>
 >>>>>> cmd<br> >>>>>> +R.<br> >>>>>> Could that be done in some way? If yes, could you please a<br> >>>>>> minimal<br> >>>>>> example how to code it?<br>
 >>>>><br> >>>>><br> >>>>> Try setting TM_PYTHON to "/path/to/python3.0". It can be set per-<br> >>>>> project or globally in TextMate's preferences. This will make ⌘R<br>
 >>>>> use<br> >>>>> Python 3, but it might also be enough to break some commands. I<br> >>>>> haven't tried it.<br> >>>><br> >>>> Commands should use /usr/bin/env python — not TM_PYTHON — so<br>
 >>>> this<br> >>>> should be ok.  You can also use a hash-bang at the start of your<br> >>>> script, and ⌘R will respect that.<br> >>><br> >>> May I miss something here, but I used<br>
 >>><br> >>> #!/usr/bin/env python<br> >>> print ("hallo world")<br> >>><br> >>> and the output window of TM says (it's writter directly under the<br> >>> field where your can change the theme) that Python 2.5.1 is used. Is<br>
 >>> there no way to use 3.0.1?<br> >><br> >> Try:<br> >><br> >> #!/usr/bin/env python3.0<br> >> print ("hallo world")<br> ><br> > This produces<br> ><br> > env: python3.0: No such file or directory<br>
 ><br> > Do I have to add something to env?<br> <br> </div></div>in terminal do “echo PATH | pbcopy”.  This puts your path on the<br> clipboard.  Now go to TextMate's advanced prefpane, and add a new PATH<br> variable in the Shell Variables tab.  Paste in your PATH from the<br>
 terminal, and now everything should work (assuming that python3.0 is<br> on the shell PATH).<br> <br> alternatively, in Terminal do “which python3.0” and use the result<br> as your #!.<br> <font color="#888888"><br> —Alex<br>
 </font><div><div></div><div><br> <br> _______________________________________________<br> textmate mailing list<br> <a href="mailto:textmate@lists.macromates.com" target="_blank">textmate@lists.macromates.com</a><br> <a href="http://lists.macromates.com/listinfo/textmate" target="_blank">http://lists.macromates.com/listinfo/textmate</a><br>
 </div></div></blockquote></div><br></div> <br>_______________________________________________<br>textmate mailing list<br><a href="mailto:textmate@lists.macromates.com" target="_blank">textmate@lists.macromates.com</a><br>
<a href="http://lists.macromates.com/listinfo/textmate" target="_blank">http://lists.macromates.com/listinfo/textmate</a><br></blockquote></div></div></div><br></div></div><br><br>
_______________________________________________<br>
textmate mailing list<br>
<a href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a><br>
<a href="http://lists.macromates.com/listinfo/textmate" target="_blank">http://lists.macromates.com/listinfo/textmate</a><br>
<br></blockquote></div><br></div>