Python Script not executing in Light Table shows error

Help! I get this error again and again .... on a light table while I try to run python code

 File "C:\Python34\Lib\site.py", line 176
    file=sys.stderr)
        ^
SyntaxError: invalid syntax

This is the installation code.

+4
source share
1 answer

I have no idea about the Light Table part, but the error you are showing is the one you get if you try to execute a Python 3 function call printin Python 2 (where printit is an operator with fancy syntax, not a function). Lines 175-176 of site.pythe Python 3.4 distribution look like this: (modulo leading indentation):

print("Error processing line {:d} of {}:\n".format(n+1, fullname),
      file=sys.stderr)

, , Python 2, SyntaxError, =:

Python 2.7.8 (default, Jul  3 2014, 06:13:58) 
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print("Error processing line {:d} of {}:\n".format(n+1, fullname), file=sys.stderr)
  File "<stdin>", line 1
    print("Error processing line {:d} of {}:\n".format(n+1, fullname), file=sys.stderr)
                                                                           ^
SyntaxError: invalid syntax

Light Table Python, , - . PYTHONPATH. C:\Python34, Python 2, . OS X, Python 2 PYTHONPATH, Python 3:

noether:~ mdickinson$ export PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/
noether:~ mdickinson$ python2.7
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site.py", line 176
    file=sys.stderr)
        ^
SyntaxError: invalid syntax
+2

Source: https://habr.com/ru/post/1547627/


All Articles