简体   繁体   English

运行 paste 时出现语法错误?

[英]Syntax Error When Running paster?

No idea what happened, but all of a sudden, paster stopped working on my server (working with virtualenv and pyramid).不知道发生了什么,但突然间,paster 停止在我的服务器上工作(使用 virtualenv 和金字塔)。 Tried reinstalling everything but didn't work - same error again:尝试重新安装所有东西但没有用 - 再次出现同样的错误:

Traceback (most recent call last):
  File "bin/paster", line 7, in ?
    sys.exit(
  File "/home/user/webapps/myapp/htdocs/lib/python2.4/site-packages/PasteScript-1.7.3-py2.4.egg/paste/script/command.py", line 83, in run
    command = commands[command_name].load()
  File "/home/user/webapps/myapp/htdocs/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/home/user/webapps/myapp/htdocs/lib/python2.4/site-packages/PasteScript-1.7.3-py2.4.egg/paste/script/serve.py", line 19, in ?
     from paste.deploy import loadapp, loadserver
  File "/home/user/webapps/myapp/htdocs/lib/python2.4/site-packages/PasteDeploy-1.5.0-py2.4.egg/paste/deploy/__init__.py", line 3, in ?
    from paste.deploy.loadwsgi import *
  File "/home/user/webapps/myapp/htdocs/lib/python2.4/site-packages/PasteDeploy-1.5.0-py2.4.egg/paste/deploy/loadwsgi.py", line 393
    with open(filename) as f:
            ^
SyntaxError: invalid syntax

What is happening to me?我是怎么了?

You are using Python 2.4.您正在使用 Python 2.4。 It does not have the with statement.它没有with语句。 It only came in Python 2.5.它仅出现在 Python 2.5 中。

Update your version of Python.更新您的 Python 版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM