Closed GoogleCodeExporter closed 8 years ago
Should be fixed in Zen Coding for Textmate v0.5 (please visit Downloads section)
Original comment by serge....@gmail.com
on 5 Jan 2010 at 5:59
I am also getting a syntax error (see below).
Traceback (most recent call last):
File "/Users/chris/Library/Application Support/TextMate/Pristine Copy/Bundles/Zen Coding.tmbundle/Support/expand_abbreviation.py", line 7, in ?
from zencoding import zen_core
File "/Users/chris/Library/Application Support/TextMate/Pristine Copy/Bundles/Zen Coding.tmbundle/Support/zencoding/zen_core.py", line 68
return text[pos] if pos < len(text) else ''
^
SyntaxError: invalid syntax
I am running Tiger (10.4.11) with Textmate (1.5.9 [1589]), Zen Coding Bundle
(0.6) and Python (2.3.5).
My Google searches haven't turned up any guidance on how to resolve this. Any
help would be much appreciated.
Regards,
Chris
Original comment by cbobb...@gmail.com
on 10 Jun 2010 at 3:11
Try to upgrade Python to 2.6
Original comment by serge....@gmail.com
on 10 Jun 2010 at 8:32
I upgraded to Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32), rebooted,
called Python via the terminal to confirm the new version, but the Zen Coding
expansion still failed. The error was identical to my previous post. I then
upgraded to Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55) and still continue
to get the same error. I'm stumped.
Original comment by cbobb...@gmail.com
on 12 Jun 2010 at 4:10
OK, this will be difficult for me to explain, but I will do my best to try in
case others have this problem.
I am running OS X Tiger 10.4.11 with TextMate 1.5.9 and Python 2.3.5. With this
setup, ZenCoding would not expand my text to HTML as expected. Instead, I
received the syntax error provided above in comment 2.
I downloaded the Python 2.6.5 installer (.DMG) from the Python website which
installed MacPython in the following location.
/Library/Frameworks/Python.framework/Versions/2.6/bin/
Note: The new version of Python is installed in a different location than the
version that comes preinstalled with OS X Tiger (2.3.5). So installing 2.6.5
DOES NOT overwrite your default version that came with the OS.
After installing Python 2.6.5, I could open the Terminal and enter "python"
which would return the text below.
Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
But in TextMate, I would still get the syntax error and here's why: I have
multiple aliases to Python and the first alias TextMate finds is the
preinstalled Python 2.3.5 and not my newly installed 2.6.5.
Note: If you type the command below in the Terminal, you can see the locations
of your aliases for Python.
$ type -a python
So here is how I got it to work. In the TextMate preferences > Advanced > Shell
Variables there is a variable called PATH. My value for PATH was this
"/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin".
In the PATH value above, "/usr/bin" contains an alias that points to Python
2.3.5 and "/usr/local/bin" has an alias pointing to Python 2.6.5. Since
"/usr/bin" came before "/usr/local/bin", TextMate would use the first reference
to Python it could find, which was 2.3.5.
The fix for me was to simply reorder my PATH values in the TextMate Shell
Variable preferences to this "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin". By
putting "/usr/local/bin" first, TextMate will follow the alias in that
directory which points to the new Python 2.6.5.
Now ZenCoding expands my text as expected!!! Ahhh...
Original comment by kerr...@gmail.com
on 18 Jun 2010 at 5:06
Original issue reported on code.google.com by
gefangen...@gmail.com
on 25 Nov 2009 at 9:47