pserve development.ini --reload:在Windows 10 64bit中失败

时间:2017-09-18 16:22:22

标签: python python-3.x pyramid reload

我正在关注an article并创建我的第一个项目

我尝试下面的命令;进程进入一个循环并启动一个服务器并杀死它并再次启动一个服务器并杀死它并继续这样做而不会破坏循环并退出。

pserve development.ini --reload

以下是日志

//---------------------------------------------------------
Starting monitor for PID 11912.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "D:\Others\Python\myBlog\lib\site-packages\hupper\ipc.py", line 322, in spawn_main

    func(**kwargs)
  File "D:\Others\Python\myBlog\lib\site-packages\hupper\worker.py", line 237, in worker_main

    func(*spec_args, **spec_kwargs)
  File "D:\Others\Python\myBlog\lib\site-packages\pyramid\scripts\pserve.py", line 32, in main

    return command.run()
  File "D:\Others\Python\myBlog\lib\site-packages\pyramid\scripts\pserve.py", line 229, in run

    app = loader.get_wsgi_app(app_name, config_vars)
  File "D:\Others\Python\myBlog\lib\site-packages\plaster_pastedeploy\__init__.py", line 131, in get_wsgi_app
    global_conf=defaults)

  File "d:\others\python\myblog\lib\site-packages\paste\deploy\loadwsgi.py", line 247, in loadapp
    return loadobj(APP, uri, name=name, **kw)

  File "d:\others\python\myblog\lib\site-packages\paste\deploy\loadwsgi.py", line 271, in loadobj
    global_conf=global_conf)

  File "d:\others\python\myblog\lib\site-packages\paste\deploy\loadwsgi.py", line 296, in loadcontext
    global_conf=global_conf)

  File "d:\others\python\myblog\lib\site-packages\paste\deploy\loadwsgi.py", line 320, in _loadconfig
    return loader.get_context(object_type, name, global_conf)

  File "d:\others\python\myblog\lib\site-packages\paste\deploy\loadwsgi.py", line 450, in get_context
    global_additions=global_additions)

  File "d:\others\python\myblog\lib\site-packages\paste\deploy\loadwsgi.py", line 562, in _pipeline_app_context
    for name in pipeline[:-1]]

  File "d:\others\python\myblog\lib\site-packages\paste\deploy\loadwsgi.py", line 562, in <listcomp>
    for name in pipeline[:-1]]

  File "d:\others\python\myblog\lib\site-packages\paste\deploy\loadwsgi.py", line 406, in get_context
    global_conf=global_conf)

  File "d:\others\python\myblog\lib\site-packages\paste\deploy\loadwsgi.py", line 296, in loadcontext
    global_conf=global_conf)

  File "d:\others\python\myblog\lib\site-packages\paste\deploy\loadwsgi.py", line 328, in _loadegg
    return loader.get_context(object_type, name, global_conf)

  File "d:\others\python\myblog\lib\site-packages\paste\deploy\loadwsgi.py", line 620, in get_context
    object_type, name=name)

  File "d:\others\python\myblog\lib\site-packages\paste\deploy\loadwsgi.py", line 646, in find_egg_entry_point
    possible.append((entry.load(), protocol, entry.name))

  File "D:\Others\Python\myBlog\lib\site-packages\pkg_resources\__init__.py", line 2405, in load
    return self.resolve()

  File "D:\Others\Python\myBlog\lib\site-packages\pkg_resources\__init__.py", line 2411, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)

  File "D:\Others\Python\myBlog\lib\site-packages\weberror-0.13.1-py3.6.egg\weberror\evalexception.py", line 127
    except ValueError, ve:
                     ^

SyntaxError: invalid syntax

Killing server with PID 11912.

Starting monitor for PID 4564.

Traceback (most recent call last):

1 个答案:

答案 0 :(得分:2)

看起来您尝试使用的库不是为Python 3构建的。except SomeException, v:语法仅在Python 2中有效。在Python 3中,您必须使用except SomeException as v:。尝试使用Python 2运行它或找到支持Python 3的此库的更新版本。

Python try...except comma vs 'as' in except