运行 Paster 时出现语法错误?

发布于 2024-11-24 14:55:25 字数 1171 浏览 3 评论 0原文

不知道发生了什么,但突然之间,粘贴器停止在我的服务器上工作(与 virtualenv 和金字塔一起工作)。尝试重新安装所有内容,但没有成功 - 再次出现同样的错误:

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

我发生了什么事?

No idea what happened, but all of a sudden, paster stopped working on my server (working with virtualenv and pyramid). 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

╰沐子 2024-12-01 14:55:25

您正在使用Python 2.4。它没有 with 语句。它仅出现在 Python 2.5 中。

更新您的 Python 版本。

You are using Python 2.4. It does not have the with statement. It only came in Python 2.5.

Update your version of Python.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文