SQLAlchemy pool.addListener 错误

发布于 2024-10-26 20:27:14 字数 2778 浏览 6 评论 0原文

我正在创建一个塔式应用程序,但在尝试使用粘贴启动应用程序时不断收到错误。我在谷歌上搜索了答案,但一无所获。有人有什么想法吗?

Traceback (most recent call last):  
File "/opt/python2.7/bin/paster", line 8, in <module>  
load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')()  
File "/opt/python2.7/lib/python2.7/site-packages/PasteScript-1.7.3-py2.7.egg/paste/script/command.py", line 84, in run  
invoke(command, command_name, options, args[1:])  
File "/opt/python2.7/lib/python2.7/site-packages/PasteScript-1.7.3-py2.7.egg/paste/script/command.py", line 123, in invoke  
exit_code = runner.run(args)  
File "/opt/python2.7/lib/python2.7/site-packages/PasteScript-1.7.3-py2.7.egg/paste/script/command.py", line 218, in run  
result = self.command()  
File "/opt/python2.7/lib/python2.7/site-packages/PasteScript-1.7.3-py2.7.egg/paste/script/serve.py", line 276, in command  
relative_to=base, global_conf=vars)  
File "/opt/python2.7/lib/python2.7/site-packages/PasteScript-1.7.3-py2.7.egg/paste/script/serve.py", line 313, in loadapp  
**kw)  
File "/opt/python2.7/lib/python2.7/site-packages/PasteDeploy-1.3.4-py2.7.egg/paste/deploy/loadwsgi.py", line 203, in loadapp  
return loadobj(APP, uri, name=name, **kw)  
File "/opt/python2.7/lib/python2.7/site-packages/PasteDeploy-1.3.4-py2.7.egg/paste/deploy/loadwsgi.py", line 224, in loadobj  
return context.create()  
File "/opt/python2.7/lib/python2.7/site-packages/PasteDeploy-1.3.4-py2.7.egg/paste/deploy/loadwsgi.py", line 617, in create  
return self.object_type.invoke(self)  
File "/opt/python2.7/lib/python2.7/site-packages/PasteDeploy-1.3.4-py2.7.egg/paste/deploy/loadwsgi.py", line 109, in invoke  
return fix_call(context.object, context.global_conf, **context.local_conf)  
File "/opt/python2.7/lib/python2.7/site-packages/PasteDeploy-1.3.4-py2.7.egg/paste/deploy/util/fixtypeerror.py", line 57, in fix_call  
val = callable(*args, **kw)  
File "/home/tripwire/foo.com/foo/foo/config/middleware.py", line 37, in make_app  
config = load_environment(global_conf, app_conf)  
File "/home/tripwire/foo.com/foo/foo/config/environment.py", line 49, in load_environment  
engine = engine_from_config(config, 'sqlalchemy.')  
File "/opt/python2.7/lib/python2.7/site-packages/SQLAlchemy-0.6.6-py2.7.egg/sqlalchemy/engine/__init__.py", line 281, in engine_from_config  
return create_engine(url, **opts)  
File "/opt/python2.7/lib/python2.7/site-packages/SQLAlchemy-0.6.6-py2.7.egg/sqlalchemy/engine/__init__.py", line 263, in create_engine  
return strategy.create(*args, **kwargs)  
File "/opt/python2.7/lib/python2.7/site-packages/SQLAlchemy-0.6.6-py2.7.egg/sqlalchemy/engine/strategies.py", line 152, in create  
pool.add_listener({'first_connect':first_connect})  
AttributeError: 'str' object has no attribute 'add_listener'  

I'm creating a pylons app and I keep getting an error when trying to start the app with paster. I've searched for answers on google and keep coming up with nothing. Anyone have any ideas?

Traceback (most recent call last):  
File "/opt/python2.7/bin/paster", line 8, in <module>  
load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')()  
File "/opt/python2.7/lib/python2.7/site-packages/PasteScript-1.7.3-py2.7.egg/paste/script/command.py", line 84, in run  
invoke(command, command_name, options, args[1:])  
File "/opt/python2.7/lib/python2.7/site-packages/PasteScript-1.7.3-py2.7.egg/paste/script/command.py", line 123, in invoke  
exit_code = runner.run(args)  
File "/opt/python2.7/lib/python2.7/site-packages/PasteScript-1.7.3-py2.7.egg/paste/script/command.py", line 218, in run  
result = self.command()  
File "/opt/python2.7/lib/python2.7/site-packages/PasteScript-1.7.3-py2.7.egg/paste/script/serve.py", line 276, in command  
relative_to=base, global_conf=vars)  
File "/opt/python2.7/lib/python2.7/site-packages/PasteScript-1.7.3-py2.7.egg/paste/script/serve.py", line 313, in loadapp  
**kw)  
File "/opt/python2.7/lib/python2.7/site-packages/PasteDeploy-1.3.4-py2.7.egg/paste/deploy/loadwsgi.py", line 203, in loadapp  
return loadobj(APP, uri, name=name, **kw)  
File "/opt/python2.7/lib/python2.7/site-packages/PasteDeploy-1.3.4-py2.7.egg/paste/deploy/loadwsgi.py", line 224, in loadobj  
return context.create()  
File "/opt/python2.7/lib/python2.7/site-packages/PasteDeploy-1.3.4-py2.7.egg/paste/deploy/loadwsgi.py", line 617, in create  
return self.object_type.invoke(self)  
File "/opt/python2.7/lib/python2.7/site-packages/PasteDeploy-1.3.4-py2.7.egg/paste/deploy/loadwsgi.py", line 109, in invoke  
return fix_call(context.object, context.global_conf, **context.local_conf)  
File "/opt/python2.7/lib/python2.7/site-packages/PasteDeploy-1.3.4-py2.7.egg/paste/deploy/util/fixtypeerror.py", line 57, in fix_call  
val = callable(*args, **kw)  
File "/home/tripwire/foo.com/foo/foo/config/middleware.py", line 37, in make_app  
config = load_environment(global_conf, app_conf)  
File "/home/tripwire/foo.com/foo/foo/config/environment.py", line 49, in load_environment  
engine = engine_from_config(config, 'sqlalchemy.')  
File "/opt/python2.7/lib/python2.7/site-packages/SQLAlchemy-0.6.6-py2.7.egg/sqlalchemy/engine/__init__.py", line 281, in engine_from_config  
return create_engine(url, **opts)  
File "/opt/python2.7/lib/python2.7/site-packages/SQLAlchemy-0.6.6-py2.7.egg/sqlalchemy/engine/__init__.py", line 263, in create_engine  
return strategy.create(*args, **kwargs)  
File "/opt/python2.7/lib/python2.7/site-packages/SQLAlchemy-0.6.6-py2.7.egg/sqlalchemy/engine/strategies.py", line 152, in create  
pool.add_listener({'first_connect':first_connect})  
AttributeError: 'str' object has no attribute 'add_listener'  

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

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

发布评论

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

评论(1

鹿港小镇 2024-11-02 20:27:14

我明白了,我正在使用的书据说可以使用
sqlalchemy.pool = 3600
但显然它应该是
sqlalchemy.pool_recycle = 3600

I figured it out, the book i was using said to use
sqlalchemy.pool = 3600
But apparently it's supposed to be
sqlalchemy.pool_recycle = 3600

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