Hi list,
I started python and therefore I downloaded v3.0.1 as a dmg and installed it.
If I test the version in the terminal with
python -V
it returns
Python 2.5.1
The same is used within Textmate.
I thought the old one will be updated with the new version... How could I used the new version of python and where got it installed?
Thanks in advance Christian
I haven't installed Python 3.x on my machine--I'm using the Python 2.5.1 that comes with Mac OS X 10.5. So I'm guessing below--I might be wrong.
`which python` returns /usr/bin/python on my machine. And `ls -l /usr/bin/python` shows it's a symbolic link to /System/Library/Frameworks/Python.framework/Versions/2.5/bin/python. `ls -l /System/Library/Frameworks/Python.framework/Versions/` shows:
drwxr-xr-x 7 root wheel 238 Feb 21 2008 2.3 drwxr-xr-x 12 root wheel 408 Feb 15 21:47 2.5 lrwxr-xr-x 1 root wheel 3 Feb 21 2008 Current -> 2.5
If Python 3.0.1 is installed in /System/Library/Frameworks/Python.framework/Versions/ on your machine, you may just need to change the /usr/bin/python symbolic link to point to /System/Library/Frameworks/Python.framework/Versions/3.0/bin/python. (And you may also want to change the /System/Library/Frameworks/Python.framework/Versions/Current symbolic link to point to /System/Library/Frameworks/Python.framework/Versions/3.0.)
-- Daryl
On Fri, Mar 13, 2009 at 8:33 AM, Christian maillists@gmx.de wrote:
Hi list,
I started python and therefore I downloaded v3.0.1 as a dmg and installed it.
If I test the version in the terminal with
python -V
it returns
Python 2.5.1
The same is used within Textmate.
I thought the old one will be updated with the new version... How could I used the new version of python and where got it installed?
Thanks in advance Christian
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On Mar 13, 2009, at 8:33 AM, Christian wrote:
Hi list,
I started python and therefore I downloaded v3.0.1 as a dmg and installed it.
If I test the version in the terminal with
python -V
it returns
Python 2.5.1
The same is used within Textmate.
I thought the old one will be updated with the new version... How could I used the new version of python and where got it installed?
You can use Python 3.0 by calling “python3.0” on the command line. I don't think it would be wise to change the python symlink to python3.0 because some TextMate commands use python and these might not work with version 3.0.
—Alex
I don't think it would be wise to change the python symlink to python3.0 because some TextMate commands use python and these might not work with version 3.0.
I hadn't thought of that. Good advice.
-- Daryl
On Fri, Mar 13, 2009 at 10:07 AM, Alex Ross tm-alex@rosiba.com wrote:
On Mar 13, 2009, at 8:33 AM, Christian wrote:
Hi list,
I started python and therefore I downloaded v3.0.1 as a dmg and installed it.
If I test the version in the terminal with
python -V
it returns
Python 2.5.1
The same is used within Textmate.
I thought the old one will be updated with the new version... How could I used the new version of python and where got it installed?
You can use Python 3.0 by calling “python3.0” on the command line. I don't think it would be wise to change the python symlink to python3.0 because some TextMate commands use python and these might not work with version 3.0.
—Alex
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Am 13.03.2009 um 18:07 schrieb Alex Ross:
On Mar 13, 2009, at 8:33 AM, Christian wrote:
Hi list,
I started python and therefore I downloaded v3.0.1 as a dmg and installed it.
If I test the version in the terminal with
python -V
it returns
Python 2.5.1
The same is used within Textmate.
I thought the old one will be updated with the new version... How could I used the new version of python and where got it installed?
You can use Python 3.0 by calling “python3.0” on the command line. I don't think it would be wise to change the python symlink to python3.0 because some TextMate commands use python and these might not work with version 3.0.
But I would like to use Python v3 within TextMate when pressing cmd+R. Could that be done in some way? If yes, could you please a minimal example how to code it?
Thanks Christian
On 2009-Mar-13, at 2:15 PM, Christian wrote:
But I would like to use Python v3 within TextMate when pressing cmd+R. Could that be done in some way? If yes, could you please a minimal example how to code it?
Try setting TM_PYTHON to "/path/to/python3.0". It can be set per- project or globally in TextMate's preferences. This will make ⌘R use Python 3, but it might also be enough to break some commands. I haven't tried it.
On Mar 13, 2009, at 12:59 PM, Rob McBroom wrote:
On 2009-Mar-13, at 2:15 PM, Christian wrote:
But I would like to use Python v3 within TextMate when pressing cmd +R. Could that be done in some way? If yes, could you please a minimal example how to code it?
Try setting TM_PYTHON to "/path/to/python3.0". It can be set per- project or globally in TextMate's preferences. This will make ⌘R use Python 3, but it might also be enough to break some commands. I haven't tried it.
Commands should use /usr/bin/env python — not TM_PYTHON — so this should be ok. You can also use a hash-bang at the start of your script, and ⌘R will respect that.
Am 13.03.2009 um 21:12 schrieb Alex Ross:
On Mar 13, 2009, at 12:59 PM, Rob McBroom wrote:
On 2009-Mar-13, at 2:15 PM, Christian wrote:
But I would like to use Python v3 within TextMate when pressing cmd +R. Could that be done in some way? If yes, could you please a minimal example how to code it?
Try setting TM_PYTHON to "/path/to/python3.0". It can be set per- project or globally in TextMate's preferences. This will make ⌘R use Python 3, but it might also be enough to break some commands. I haven't tried it.
Commands should use /usr/bin/env python — not TM_PYTHON — so this should be ok. You can also use a hash-bang at the start of your script, and ⌘R will respect that.
May I miss something here, but I used
#!/usr/bin/env python print ("hallo world")
and the output window of TM says (it's writter directly under the field where your can change the theme) that Python 2.5.1 is used. Is there no way to use 3.0.1?
Thanks Christian
On Fri, Mar 13, 2009 at 1:27 PM, Christian maillists@gmx.de wrote:
Am 13.03.2009 um 21:12 schrieb Alex Ross:
On Mar 13, 2009, at 12:59 PM, Rob McBroom wrote:
On 2009-Mar-13, at 2:15 PM, Christian wrote:
But I would like to use Python v3 within TextMate when pressing cmd +R. Could that be done in some way? If yes, could you please a minimal example how to code it?
Try setting TM_PYTHON to "/path/to/python3.0". It can be set per- project or globally in TextMate's preferences. This will make ⌘R use Python 3, but it might also be enough to break some commands. I haven't tried it.
Commands should use /usr/bin/env python — not TM_PYTHON — so this should be ok. You can also use a hash-bang at the start of your script, and ⌘R will respect that.
May I miss something here, but I used
#!/usr/bin/env python print ("hallo world")
and the output window of TM says (it's writter directly under the field where your can change the theme) that Python 2.5.1 is used. Is there no way to use 3.0.1?
Try:
#!/usr/bin/env python3.0 print ("hallo world")
I have both 2.5 and 2.6 installed on my system and both
#!/usr/bin/env python2.5 print ("hallo world")
#!/usr/bin/env python2.6 print ("hallo world")
work as desired
Thanks Christian
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Am 13.03.2009 um 21:34 schrieb Peter Cowan:
On Fri, Mar 13, 2009 at 1:27 PM, Christian maillists@gmx.de wrote:
Am 13.03.2009 um 21:12 schrieb Alex Ross:
On Mar 13, 2009, at 12:59 PM, Rob McBroom wrote:
On 2009-Mar-13, at 2:15 PM, Christian wrote:
But I would like to use Python v3 within TextMate when pressing cmd +R. Could that be done in some way? If yes, could you please a minimal example how to code it?
Try setting TM_PYTHON to "/path/to/python3.0". It can be set per- project or globally in TextMate's preferences. This will make ⌘R use Python 3, but it might also be enough to break some commands. I haven't tried it.
Commands should use /usr/bin/env python — not TM_PYTHON — so this should be ok. You can also use a hash-bang at the start of your script, and ⌘R will respect that.
May I miss something here, but I used
#!/usr/bin/env python print ("hallo world")
and the output window of TM says (it's writter directly under the field where your can change the theme) that Python 2.5.1 is used. Is there no way to use 3.0.1?
Try:
#!/usr/bin/env python3.0 print ("hallo world")
This produces
env: python3.0: No such file or directory
Do I have to add something to env?
Christian
On Mar 13, 2009, at 1:40 PM, Christian wrote:
Am 13.03.2009 um 21:34 schrieb Peter Cowan:
On Fri, Mar 13, 2009 at 1:27 PM, Christian maillists@gmx.de wrote:
Am 13.03.2009 um 21:12 schrieb Alex Ross:
On Mar 13, 2009, at 12:59 PM, Rob McBroom wrote:
On 2009-Mar-13, at 2:15 PM, Christian wrote:
But I would like to use Python v3 within TextMate when pressing cmd +R. Could that be done in some way? If yes, could you please a minimal example how to code it?
Try setting TM_PYTHON to "/path/to/python3.0". It can be set per- project or globally in TextMate's preferences. This will make ⌘R use Python 3, but it might also be enough to break some commands. I haven't tried it.
Commands should use /usr/bin/env python — not TM_PYTHON — so this should be ok. You can also use a hash-bang at the start of your script, and ⌘R will respect that.
May I miss something here, but I used
#!/usr/bin/env python print ("hallo world")
and the output window of TM says (it's writter directly under the field where your can change the theme) that Python 2.5.1 is used. Is there no way to use 3.0.1?
Try:
#!/usr/bin/env python3.0 print ("hallo world")
This produces
env: python3.0: No such file or directory
Do I have to add something to env?
in terminal do “echo PATH | pbcopy”. This puts your path on the clipboard. Now go to TextMate's advanced prefpane, and add a new PATH variable in the Shell Variables tab. Paste in your PATH from the terminal, and now everything should work (assuming that python3.0 is on the shell PATH).
alternatively, in Terminal do “which python3.0” and use the result as your #!.
—Alex
Am 13.03.2009 um 21:46 schrieb Alex Ross:
On Mar 13, 2009, at 1:40 PM, Christian wrote:
Am 13.03.2009 um 21:34 schrieb Peter Cowan:
On Fri, Mar 13, 2009 at 1:27 PM, Christian maillists@gmx.de wrote:
Am 13.03.2009 um 21:12 schrieb Alex Ross:
On Mar 13, 2009, at 12:59 PM, Rob McBroom wrote:
On 2009-Mar-13, at 2:15 PM, Christian wrote:
> But I would like to use Python v3 within TextMate when pressing > cmd > +R. > Could that be done in some way? If yes, could you please a > minimal > example how to code it?
Try setting TM_PYTHON to "/path/to/python3.0". It can be set per- project or globally in TextMate's preferences. This will make ⌘R use Python 3, but it might also be enough to break some commands. I haven't tried it.
Commands should use /usr/bin/env python — not TM_PYTHON — so this should be ok. You can also use a hash-bang at the start of your script, and ⌘R will respect that.
May I miss something here, but I used
#!/usr/bin/env python print ("hallo world")
and the output window of TM says (it's writter directly under the field where your can change the theme) that Python 2.5.1 is used. Is there no way to use 3.0.1?
Try:
#!/usr/bin/env python3.0 print ("hallo world")
This produces
env: python3.0: No such file or directory
Do I have to add something to env?
in terminal do “echo PATH | pbcopy”. This puts your path on the clipboard. Now go to TextMate's advanced prefpane, and add a new PATH variable in the Shell Variables tab. Paste in your PATH from the terminal, and now everything should work (assuming that python3.0 is on the shell PATH).
After doing
echo PATH | pbcopy
nothing is copied to the clipbord because nothing gets filled in when adding a new shell variable to TM.
alternatively, in Terminal do “which python3.0” and use the result as your #!.
For some reason there is no eal answer when I do which...
ChristiansMacBook:~ christian$ which python3.0 ChristiansMacBook:~ christian$
Christian
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. 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".
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:
#!/usr/bin/env python import sys
print(sys.version) #=> 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
and
#!/usr/bin/env python3.0 import sys
print(sys.version) #=> 3.0.1 (r301:69597, Feb 14 2009, 19:03:52)
Hope that helps.
Andrei Maxim http://artfulco.de
On Fri, Mar 13, 2009 at 10:46 PM, Alex Ross tm-alex@rosiba.com wrote:
On Mar 13, 2009, at 1:40 PM, Christian wrote:
Am 13.03.2009 um 21:34 schrieb Peter Cowan:
On Fri, Mar 13, 2009 at 1:27 PM, Christian maillists@gmx.de wrote:
Am 13.03.2009 um 21:12 schrieb Alex Ross:
On Mar 13, 2009, at 12:59 PM, Rob McBroom wrote:
On 2009-Mar-13, at 2:15 PM, Christian wrote:
> But I would like to use Python v3 within TextMate when pressing > cmd > +R. > Could that be done in some way? If yes, could you please a > minimal > example how to code it?
Try setting TM_PYTHON to "/path/to/python3.0". It can be set per- project or globally in TextMate's preferences. This will make ⌘R use Python 3, but it might also be enough to break some commands. I haven't tried it.
Commands should use /usr/bin/env python — not TM_PYTHON — so this should be ok. You can also use a hash-bang at the start of your script, and ⌘R will respect that.
May I miss something here, but I used
#!/usr/bin/env python print ("hallo world")
and the output window of TM says (it's writter directly under the field where your can change the theme) that Python 2.5.1 is used. Is there no way to use 3.0.1?
Try:
#!/usr/bin/env python3.0 print ("hallo world")
This produces
env: python3.0: No such file or directory
Do I have to add something to env?
in terminal do “echo PATH | pbcopy”. This puts your path on the clipboard. Now go to TextMate's advanced prefpane, and add a new PATH variable in the Shell Variables tab. Paste in your PATH from the terminal, and now everything should work (assuming that python3.0 is on the shell PATH).
alternatively, in Terminal do “which python3.0” and use the result as your #!.
—Alex
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Thanks for helping me out.
Now TM also uses v3.0.1. But when I use cmd+R the following error message appears with the output:
Error in sitecustomize; set PYTHONVERBOSE for traceback: NameError: name 'reload' is not defined hallo world
How could this be corrected?
Thanks Christian
Am 13.03.2009 um 22:14 schrieb Andrei Maxim:
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.
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".
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:
#!/usr/bin/env python import sys
print(sys.version) #=> 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
and
#!/usr/bin/env python3.0 import sys
print(sys.version) #=> 3.0.1 (r301:69597, Feb 14 2009, 19:03:52)
Hope that helps.
Andrei Maxim http://artfulco.de
On Fri, Mar 13, 2009 at 10:46 PM, Alex Ross tm-alex@rosiba.com wrote:
On Mar 13, 2009, at 1:40 PM, Christian wrote:
Am 13.03.2009 um 21:34 schrieb Peter Cowan:
On Fri, Mar 13, 2009 at 1:27 PM, Christian maillists@gmx.de
wrote:
Am 13.03.2009 um 21:12 schrieb Alex Ross:
On Mar 13, 2009, at 12:59 PM, Rob McBroom wrote:
On 2009-Mar-13, at 2:15 PM, Christian wrote:
> But I would like to use Python v3 within TextMate when pressing > cmd > +R. > Could that be done in some way? If yes, could you please a > minimal > example how to code it?
Try setting TM_PYTHON to "/path/to/python3.0". It can be set
per-
project or globally in TextMate's preferences. This will make
⌘R
use Python 3, but it might also be enough to break some commands. I haven't tried it.
Commands should use /usr/bin/env python — not TM_PYTHON — so this should be ok. You can also use a hash-bang at the start of your script, and ⌘R will respect that.
May I miss something here, but I used
#!/usr/bin/env python print ("hallo world")
and the output window of TM says (it's writter directly under the field where your can change the theme) that Python 2.5.1 is
used. Is
there no way to use 3.0.1?
Try:
#!/usr/bin/env python3.0 print ("hallo world")
This produces
env: python3.0: No such file or directory
Do I have to add something to env?
in terminal do “echo PATH | pbcopy”. This puts your path on the clipboard. Now go to TextMate's advanced prefpane, and add a new PATH variable in the Shell Variables tab. Paste in your PATH from the terminal, and now everything should work (assuming that python3.0 is on the shell PATH).
alternatively, in Terminal do “which python3.0” and use the result as your #!.
—Alex
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
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: # Setting PATH for MacPython 3.0 # The orginal version is saved in .bash_login.pysave PATH="${PATH}:/Library/Frameworks/Python.framework/Versions/3.0/bin" export PATH
When running this tiny program I get the expected output:
#!/usr/bin/env python3.0 print ("hallo world")
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).
Andrei Maxim http://artfulco.de
On Sat, Mar 14, 2009 at 10:04 AM, Christian maillists@gmx.de wrote:
Thanks for helping me out. Now TM also uses v3.0.1. But when I use cmd+R the following error message appears with the output:
Error in sitecustomize; set PYTHONVERBOSE for traceback: NameError: name 'reload' is not defined hallo world
How could this be corrected?
Thanks Christian
Am 13.03.2009 um 22:14 schrieb Andrei Maxim:
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. 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".
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:
#!/usr/bin/env python import sys
print(sys.version) #=> 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
and
#!/usr/bin/env python3.0 import sys
print(sys.version) #=> 3.0.1 (r301:69597, Feb 14 2009, 19:03:52)
Hope that helps.
Andrei Maxim http://artfulco.de
On Fri, Mar 13, 2009 at 10:46 PM, Alex Ross tm-alex@rosiba.com wrote:
On Mar 13, 2009, at 1:40 PM, Christian wrote:
Am 13.03.2009 um 21:34 schrieb Peter Cowan:
On Fri, Mar 13, 2009 at 1:27 PM, Christian maillists@gmx.de wrote:
Am 13.03.2009 um 21:12 schrieb Alex Ross:
On Mar 13, 2009, at 12:59 PM, Rob McBroom wrote:
> On 2009-Mar-13, at 2:15 PM, Christian wrote: > >> But I would like to use Python v3 within TextMate when pressing >> cmd >> +R. >> Could that be done in some way? If yes, could you please a >> minimal >> example how to code it? > > > Try setting TM_PYTHON to "/path/to/python3.0". It can be set per- > project or globally in TextMate's preferences. This will make ⌘R > use > Python 3, but it might also be enough to break some commands. I > haven't tried it.
Commands should use /usr/bin/env python — not TM_PYTHON — so this should be ok. You can also use a hash-bang at the start of your script, and ⌘R will respect that.
May I miss something here, but I used
#!/usr/bin/env python print ("hallo world")
and the output window of TM says (it's writter directly under the field where your can change the theme) that Python 2.5.1 is used. Is there no way to use 3.0.1?
Try:
#!/usr/bin/env python3.0 print ("hallo world")
This produces
env: python3.0: No such file or directory
Do I have to add something to env?
in terminal do “echo PATH | pbcopy”. This puts your path on the clipboard. Now go to TextMate's advanced prefpane, and add a new PATH variable in the Shell Variables tab. Paste in your PATH from the terminal, and now everything should work (assuming that python3.0 is on the shell PATH).
alternatively, in Terminal do “which python3.0” and use the result as your #!.
—Alex
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Am 14.03.2009 um 09:26 schrieb Andrei Maxim:
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:
# Setting PATH for MacPython 3.0 # The orginal version is saved in .bash_login.pysave PATH="${PATH}:/Library/Frameworks/Python.framework/Versions/3.0/bin" export PATH
When running this tiny program I get the expected output:
#!/usr/bin/env python3.0 print ("hallo world")
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).
I do not have a file called .bash_login. But when I type
env
into the terminal I get
PATH=/Library/Frameworks/Python.framework/Versions/3.0/bin:/sw/bin:/sw/ sbin:/sw/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/ usr/X11/bin:/usr/X11R6/bin
Which means the path is already set correctly, isnt it?
But I still get the error message, als after a reinstall of TM,
Error in sitecustomize; set PYTHONVERBOSE for traceback: NameError: name 'reload' is not defined hallo world
How could that be resolved?
Thanks Christian
Am 15.03.2009 um 02:36 schrieb Alex Ross:
On Mar 14, 2009, at 10:56 AM, Christian wrote:
Error in sitecustomize; set PYTHONVERBOSE for traceback: NameError: name 'reload' is not defined hallo world
How could that be resolved?
Have you upgraded to the cutting-edge TextMate? I think that may fix it.
Checked just now:
Latest cutting-edge build of TextMate is 1498. You are using build 1498.
Am 15.03.2009 um 02:36 schrieb Alex Ross:
On Mar 14, 2009, at 10:56 AM, Christian wrote:
Error in sitecustomize; set PYTHONVERBOSE for traceback: NameError: name 'reload' is not defined hallo world
How could that be resolved?
Have you upgraded to the cutting-edge TextMate? I think that may fix it.
Hi Alex,
now I run into that problems you warned me before.
when I typset something for LaTeX, I get lots of errors regarding the syntax errors in Python files that the LaTeX.bundle uses.
Nevertheless, I realy need to learn Python 3 for my work as well asneed to work with LaTeX.
Is there a way to solve this..?
Thanks Christian
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.
Andrei Maxim http://artfulco.de
On Sun, Mar 15, 2009 at 10:25 AM, Christian maillists@gmx.de wrote:
Am 15.03.2009 um 02:36 schrieb Alex Ross:
On Mar 14, 2009, at 10:56 AM, Christian wrote:
Error in sitecustomize; set PYTHONVERBOSE for traceback: NameError: name 'reload' is not defined hallo world
How could that be resolved?
Have you upgraded to the cutting-edge TextMate? I think that may fix it.
Hi Alex,
now I run into that problems you warned me before.
when I typset something for LaTeX, I get lots of errors regarding the syntax errors in Python files that the LaTeX.bundle uses.
Nevertheless, I realy need to learn Python 3 for my work as well asneed to work with LaTeX.
Is there a way to solve this..?
Thanks Christian
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
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
Christian, I'm not sure how TextMate works with PATH variables. My best guess is that if it works between TextMate restarts it's OK.
Andrei Maxim http://artfulco.de
On Sun, Mar 15, 2009 at 3:07 PM, Christian maillists@gmx.de wrote:
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
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On Mar 15, 2009, at 6:07 AM, Christian wrote:
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?
You should be good to go.
Am 15.03.2009 um 19:34 schrieb Alex Ross:
On Mar 15, 2009, at 6:07 AM, Christian wrote:
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?
You should be good to go.
Thanks guys for the patient help!
But I am still getting the error with Python v3
Error in sitecustomize; set PYTHONVERBOSE for traceback: NameError: name 'reload' is not defined hallo world
What is going wrong and how could I resolve it?
Christian
I think this is an incompatibility between the bundle and python 3. I asked the same question a while back and didn't receive an answer. To quote Dive Into Python - sitecustomize.py is a special script; Python will try to import it on startup, so any code in it will be run automatically. As the comment mentions, it can go anywhere (as long asimport can find it), but it usually goes in the site-packages directory within your Python lib directory.
But I found this answer on the list -
http://lists.macromates.com/textmate/2009-February/028088.html
Basically you need to patch the sitecustomize.py which is found inside the python bundle you are using.
Hope this helps,
MP
On 16/03/2009, at 4:00 PM, Christian wrote:
Am 15.03.2009 um 19:34 schrieb Alex Ross:
On Mar 15, 2009, at 6:07 AM, Christian wrote:
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?
You should be good to go.
Thanks guys for the patient help!
But I am still getting the error with Python v3
Error in sitecustomize; set PYTHONVERBOSE for traceback: NameError: name 'reload' is not defined hallo world
What is going wrong and how could I resolve it?
Christian
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On Mar 16, 2009, at 3:24 AM, Mark Perrin wrote:
I think this is an incompatibility between the bundle and python 3. I asked the same question a while back and didn't receive an answer. To quote Dive Into Python - sitecustomize.py is a special script; Python will try to import it on startup, so any code in it will be run automatically. As the comment mentions, it can go anywhere (as long asimport can find it), but it usually goes in the site-packages directory within your Python lib directory.
But I found this answer on the list -
http://lists.macromates.com/textmate/2009-February/028088.html
Basically you need to patch the sitecustomize.py which is found inside the python bundle you are using.
This patch has been applied in SVN, but I guess there hasn't been an cutting-edge textmate release in a while. If you have an svn checkout of the bundles, update it. If not, you can either get one or — and this is what i recommend — modify the sitecustomize.py that is in TextMate.app's copy of the Python.tmbundle. That will eventually get overwritten when TextMate is updated.
—Alex
Am 13.03.2009 um 20:59 schrieb Rob McBroom:
On 2009-Mar-13, at 2:15 PM, Christian wrote:
But I would like to use Python v3 within TextMate when pressing cmd +R. Could that be done in some way? If yes, could you please a minimal example how to code it?
Try setting TM_PYTHON to "/path/to/python3.0". It can be set per- project or globally in TextMate's preferences. This will make ⌘R use Python 3, but it might also be enough to break some commands. I haven't tried it.
I tried to set TM_PYTHON to
/Library/Frameworks/Python.framework/Versions/3.0
but after cmd+R, I only get in the output window
Program exited with code #1 after 0.01 seconds.
and nothing more.
Do you have further hints...? Christian