以外
我正在关注文章并创建我的第一个项目
当我尝试以下命令时;该过程进入循环并启动服务器并杀死它,然后再次启动服务器并杀死,并且它不断地不破坏循环并退出。
pserve development.ini --reload
下面是日志
//---------------------------------------------------------
Starting monitor for PID 11912.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:OthersPythonmyBloglibsite-packageshupperipc.py", line 322, in spawn_main
func(**kwargs)
File "D:OthersPythonmyBloglibsite-packageshupperworker.py", line 237, in worker_main
func(*spec_args, **spec_kwargs)
File "D:OthersPythonmyBloglibsite-packagespyramidscriptspserve.py", line 32, in main
return command.run()
File "D:OthersPythonmyBloglibsite-packagespyramidscriptspserve.py", line 229, in run
app = loader.get_wsgi_app(app_name, config_vars)
File "D:OthersPythonmyBloglibsite-packagesplaster_pastedeploy__init__.py", line 131, in get_wsgi_app
global_conf=defaults)
File "d:otherspythonmybloglibsite-packagespastedeployloadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "d:otherspythonmybloglibsite-packagespastedeployloadwsgi.py", line 271, in loadobj
global_conf=global_conf)
File "d:otherspythonmybloglibsite-packagespastedeployloadwsgi.py", line 296, in loadcontext
global_conf=global_conf)
File "d:otherspythonmybloglibsite-packagespastedeployloadwsgi.py", line 320, in _loadconfig
return loader.get_context(object_type, name, global_conf)
File "d:otherspythonmybloglibsite-packagespastedeployloadwsgi.py", line 450, in get_context
global_additions=global_additions)
File "d:otherspythonmybloglibsite-packagespastedeployloadwsgi.py", line 562, in _pipeline_app_context
for name in pipeline[:-1]]
File "d:otherspythonmybloglibsite-packagespastedeployloadwsgi.py", line 562, in <listcomp>
for name in pipeline[:-1]]
File "d:otherspythonmybloglibsite-packagespastedeployloadwsgi.py", line 406, in get_context
global_conf=global_conf)
File "d:otherspythonmybloglibsite-packagespastedeployloadwsgi.py", line 296, in loadcontext
global_conf=global_conf)
File "d:otherspythonmybloglibsite-packagespastedeployloadwsgi.py", line 328, in _loadegg
return loader.get_context(object_type, name, global_conf)
File "d:otherspythonmybloglibsite-packagespastedeployloadwsgi.py", line 620, in get_context
object_type, name=name)
File "d:otherspythonmybloglibsite-packagespastedeployloadwsgi.py", line 646, in find_egg_entry_point
possible.append((entry.load(), protocol, entry.name))
File "D:OthersPythonmyBloglibsite-packagespkg_resources__init__.py", line 2405, in load
return self.resolve()
File "D:OthersPythonmyBloglibsite-packagespkg_resources__init__.py", line 2411, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "D:OthersPythonmyBloglibsite-packagesweberror-0.13.1-py3.6.eggweberrorevalexception.py", line 127
except ValueError, ve:
^
SyntaxError: invalid syntax
Killing server with PID 11912.
Starting monitor for PID 4564.
Traceback (most recent call last):
看起来您要使用的库不是为Python 3构建的。except SomeException, v:
语法仅在Python 2中有效。在Python 3中,您必须使用except SomeException as v:
。尝试使用Python 2进行运行或找到支持Python 3的较新版本。
python try ...除comma vs'as'in in