I am trying to run the demo application from Celery
the project directory is /usr/local/proj
[root#merit1 proj]# ls -lh
total 16K
-rw-r--r--. 1 root root 363 Dec 23 00:36 celery.py
-rw-r--r--. 1 root root 522 Dec 23 00:36 celery.pyc
-rw-r--r--. 1 root root 0 Dec 23 00:22 __init__.py
-rw-r--r--. 1 root root 114 Dec 23 00:36 __init__.pyc
-rw-r--r--. 1 root root 211 Dec 23 00:37 tasks.py
and celery.py
from __future__ import absolute_import
from celery import Celery
app = Celery('proj',
broker='amqp://guest#localhost//',
backend='amqp://',
include=['app.tasks'])
# Optional configuration, see the application user guide.
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
)
if __name__ == '__main__':
app.start()
and tasks.py contains
from __future__ import absolute_import
from proj.celery import app
#app.task
def add(x, y):
return x + y
#app.task
def mul(x, y):
return x * y
#app.task
def xsum(numbers):
return sum(numbers)
however when i run celery from /usr/local, i get this error
celery worker --app=proj -l info
Traceback (most recent call last):
File "/usr/bin/celery", line 9, in <module>
load_entry_point('celery==3.1.7', 'console_scripts', 'celery')()
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/__main__.py", line 30, in main
main()
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/bin/celery.py", line 80, in main
cmd.execute_from_commandline(argv)
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/bin/celery.py", line 723, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv)))
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/bin/base.py", line 303, in execute_from_commandline
return self.handle_argv(self.prog_name, argv[1:])
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/bin/celery.py", line 715, in handle_argv
return self.execute(command, argv)
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/bin/celery.py", line 669, in execute
).run_from_argv(self.prog_name, argv[1:], command=argv[0])
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/bin/worker.py", line 175, in run_from_argv
return self(*args, **options)
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/bin/base.py", line 266, in __call__
ret = self.run(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/bin/worker.py", line 208, in run
state_db=self.node_format(state_db, hostname), **kwargs
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/worker/__init__.py", line 95, in __init__
self.app.loader.init_worker()
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/loaders/base.py", line 128, in init_worker
self.import_default_modules()
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/loaders/base.py", line 121, in import_default_modules
tuple(maybe_list(self.app.conf.CELERY_INCLUDE))
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/loaders/base.py", line 103, in import_task_module
return self.import_from_cwd(module)
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/loaders/base.py", line 112, in import_from_cwd
package=package,
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/utils/imports.py", line 101, in import_from_cwd
return imp(module, package=package)
File "/usr/lib64/python2.6/contextlib.py", line 34, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/utils/imports.py", line 64, in cwd_in_path
yield cwd
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/utils/imports.py", line 101, in import_from_cwd
return imp(module, package=package)
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/loaders/base.py", line 106, in import_module
return importlib.import_module(module, package=package)
File "/usr/lib/python2.6/site-packages/importlib-1.0.2-py2.6.egg/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named app.tasks
any ideas?
UPDATE:
updated celery.py to
from __future__ import absolute_import
from celery import Celery
app = Celery('proj',
broker='amqp://guest#localhost//',
backend='amqp://',
include=['proj.tasks'])
# Optional configuration, see the application user guide.
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
)
if __name__ == '__main__':
app.start()
i now get this error
[root#merit1 local]# celery worker --app=proj -l info
Traceback (most recent call last):
File "/usr/bin/celery", line 9, in <module>
load_entry_point('celery==3.1.7', 'console_scripts', 'celery')()
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/__main__.py", line 30, in main
main()
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/bin/celery.py", line 80, in main
cmd.execute_from_commandline(argv)
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/bin/celery.py", line 723, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv)))
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/bin/base.py", line 303, in execute_from_commandline
return self.handle_argv(self.prog_name, argv[1:])
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/bin/celery.py", line 715, in handle_argv
return self.execute(command, argv)
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/bin/celery.py", line 669, in execute
).run_from_argv(self.prog_name, argv[1:], command=argv[0])
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/bin/worker.py", line 175, in run_from_argv
return self(*args, **options)
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/bin/base.py", line 266, in __call__
ret = self.run(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/bin/worker.py", line 208, in run
state_db=self.node_format(state_db, hostname), **kwargs
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/worker/__init__.py", line 95, in __init__
self.app.loader.init_worker()
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/loaders/base.py", line 128, in init_worker
self.import_default_modules()
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/loaders/base.py", line 121, in import_default_modules
tuple(maybe_list(self.app.conf.CELERY_INCLUDE))
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/loaders/base.py", line 103, in import_task_module
return self.import_from_cwd(module)
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/loaders/base.py", line 112, in import_from_cwd
package=package,
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/utils/imports.py", line 101, in import_from_cwd
return imp(module, package=package)
File "/usr/lib64/python2.6/contextlib.py", line 34, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/utils/imports.py", line 64, in cwd_in_path
yield cwd
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/utils/imports.py", line 101, in import_from_cwd
return imp(module, package=package)
File "/usr/lib/python2.6/site-packages/celery-3.1.7-py2.6.egg/celery/loaders/base.py", line 106, in import_module
return importlib.import_module(module, package=package)
File "/usr/lib/python2.6/site-packages/importlib-1.0.2-py2.6.egg/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/local/proj/tasks.py", line 8, in <module>
#app.task
TypeError: 'module' object is not callable
change your include to:
app = Celery('proj',
broker='amqp://guest#localhost//',
backend='amqp://',
include=['proj.tasks'])
see celery application doc
include – List of modules every worker should import.
Related
We have Ec2 fargate instance running on AWS, there is a celery worker which is running by
celery -A app status
Repeatedly we are getting the following error for this instance
BrokenPipeError: [Errno 32] Broken pipe
File "celery", line 8, in <module>
sys.exit(main())
File "celery/__main__.py", line 16, in main
_main()
File "celery/bin/celery.py", line 322, in main
cmd.execute_from_commandline(argv)
File "celery/bin/celery.py", line 499, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv)))
File "celery/bin/base.py", line 305, in execute_from_commandline
return self.handle_argv(self.prog_name, argv[1:])
File "celery/bin/celery.py", line 491, in handle_argv
return self.execute(command, argv)
File "celery/bin/celery.py", line 419, in execute
).run_from_argv(self.prog_name, argv[1:], command=argv[0])
File "celery/bin/base.py", line 309, in run_from_argv
sys.argv if argv is None else argv, command)
File "celery/bin/base.py", line 393, in handle_argv
return self(*args, **options)
File "celery/bin/base.py", line 253, in __call__
ret = self.run(*args, **kwargs)
File "celery/bin/control.py", line 239, in run
nodecount, text.pluralize(nodecount, 'node')))
File "celery/bin/base.py", line 413, in out
print(s, file=fh or self.stdout)
Any insights into it?
So I try to register simple Flask service with Eureka by installing a client. I did everything by the instruction from there: https://github.com/elviejokike/flask-eureka
The code I try to run:
from flask import jsonify
from flask_eureka import Eureka
from flask_eureka.eureka import eureka_bp
app = Flask(__name__)
eureka = Eureka(app)
eureka.register_service(name="my-flask-service")
app.register_blueprint(eureka_bp)
#app.route('/model')
def hello_world():
a = {"text": "I am model service!"}
return jsonify(a)
if __name__ == '__main__':
app.run()
Instead of initializing the service I get this pile of errors:
FLASK_ENV = development
FLASK_DEBUG = 0
In folder C:/Users/HP/PycharmProjects/models-service
C:\Users\HP\PycharmProjects\models-service\venv\Scripts\python.exe -m flask run
* Serving Flask app "app.py"
* Environment: development
* Debug mode: off
Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\flask\__main__.py", line 15, in <module>
main(as_module=True)
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\flask\cli.py", line 967, in main
cli.main(args=sys.argv[1:], prog_name="python -m flask" if as_module else None)
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\flask\cli.py", line 586, in main
return super(FlaskGroup, self).main(*args, **kwargs)
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\click\decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\flask\cli.py", line 848, in run_command
app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\flask\cli.py", line 305, in __init__
self._load_unlocked()
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\flask\cli.py", line 330, in _load_unlocked
self._app = rv = self.loader()
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\flask\cli.py", line 388, in load_app
app = locate_app(self, import_name, name)
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\flask\cli.py", line 240, in locate_app
__import__(module_name)
File "C:\Users\HP\PycharmProjects\models-service\app.py", line 9, in <module>
eureka.register_service(name="my-flask-service")
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\flask_eureka\eureka.py", line 51, in register_service
eureka_client = EurekaClient(name=name, host_name=host_name,
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\flask_eureka\eurekaclient.py", line 95, in __init__
host_info = HostInfo().get()
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\flask_eureka\hostinfo.py", line 34, in get
'IPv4': self.ipv4(),
File "C:\Users\HP\PycharmProjects\models-service\venv\lib\site-packages\flask_eureka\hostinfo.py", line 53, in ipv4
ipv4 = ipv4.split(':')[1]
IndexError: list index out of range
Process finished with exit code 1
Every library is installed through pip, code without eureka runs correctly. I think it might be related to OS forbidding an access to network, but I'm not quite sure and need a hand.
The module winrm is installed with all its dependencies, but still the celeryd service is not able to run. Here is the error trace:
worker1#man11idm01.stman00.isyntax.net: DOWN /usr/lib64/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6 DeprecationWarning Traceback (most recent call last): File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main
"__main__", fname, loader, pkg_name) File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
exec code in run_globals File "/usr/lib/python2.6/site-packages/celery/__main__.py", line 54, in <module>
main() File "/usr/lib/python2.6/site-packages/celery/__main__.py", line 30, in main
main() File "/usr/lib/python2.6/site-packages/celery/bin/celery.py", line 81, in main
cmd.execute_from_commandline(argv) File "/usr/lib/python2.6/site-packages/celery/bin/celery.py", line 769, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv))) File "/usr/lib/python2.6/site-packages/celery/bin/base.py", line 311, in execute_from_commandline
return self.handle_argv(self.prog_name, argv[1:]) File "/usr/lib/python2.6/site-packages/celery/bin/celery.py", line 761, in handle_argv
return self.execute(command, argv) File "/usr/lib/python2.6/site-packages/celery/bin/celery.py", line 693, in execute
).run_from_argv(self.prog_name, argv[1:], command=argv[0]) File "/usr/lib/python2.6/site-packages/celery/bin/worker.py", line 179, in run_from_argv
return self(*args, **options) File "/usr/lib/python2.6/site-packages/celery/bin/base.py", line 274, in
__call__
ret = self.run(*args, **kwargs) File "/usr/lib/python2.6/site-packages/celery/bin/worker.py", line 212, in run
state_db=self.node_format(state_db, hostname), **kwargs File "/usr/lib/python2.6/site-packages/celery/worker/__init__.py", line 95, in __init__
self.app.loader.init_worker() File "/usr/lib/python2.6/site-packages/celery/loaders/base.py", line 128, in init_worker
self.import_default_modules() File "/usr/lib/python2.6/site-packages/celery/loaders/base.py", line 121, in import_default_modules
tuple(maybe_list(self.app.conf.CELERY_INCLUDE)) File "/usr/lib/python2.6/site-packages/celery/loaders/base.py", line 103, in import_task_module
return self.import_from_cwd(module) File "/usr/lib/python2.6/site-packages/celery/loaders/base.py", line 112, in import_from_cwd
package=package, File "/usr/lib/python2.6/site-packages/celery/utils/imports.py", line 101, in import_from_cwd
return imp(module, package=package) File "/usr/lib64/python2.6/contextlib.py", line 34, in __exit__
self.gen.throw(type, value, traceback) File "/usr/lib/python2.6/site-packages/celery/utils/imports.py", line 64, in cwd_in_path
yield cwd File "/usr/lib/python2.6/site-packages/celery/utils/imports.py", line 101, in import_from_cwd
return imp(module, package=package) File "/usr/lib/python2.6/site-packages/celery/loaders/base.py", line 106, in import_module
return importlib.import_module(module, package=package) File "/usr/lib/python2.6/site-packages/importlib/__init__.py", line 37, in import_module
__import__(name) File "/usr/lib/celery/phim_onsite/operate.py", line 14, in <module>
from phim_onsite.transmit import tx_data, tx_pcm_discovery, tx_deployment_status File "/usr/lib/celery/phim_onsite/transmit.py", line 19, in <module>
from scanline.trinity import scanline_endpoints, scanline_scanner File "/usr/lib/python2.6/site-packages/scanline/trinity.py", line 15, in <module>
from scanline.product.isp import ISPProductScanner File "/usr/lib/python2.6/site-packages/scanline/product/isp.py", line 17, in <module>
from scanline.host.isp import ISPHostScanner File "/usr/lib/python2.6/site-packages/scanline/host/isp.py", line 6, in <module>
from scanline.utilities.win_rm import extract_credentials File "/usr/lib/python2.6/site-packages/scanline/utilities/win_rm.py", line 2, in <module>
import winrm ImportError: No module named winrm
Restarting node worker1#man11idm01.stman00.isyntax.net: * Child terminated with errorcode 255
FAILED
+ exit 0
Trying to run a simple example according to
http://celery.readthedocs.org/en/latest/getting-started/next-steps.html
I'm getting ImportError: No module named celery (probably due to from celery import Celery).
On python shell it works perfectly.
Running: running python <proj dir>/celery_manager.py worker does work...
What am I doing wrong?
The full dump:
celery multi v3.1.16 (Cipater)
> Starting nodes...
Traceback (most recent call last):
File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
exec code in run_globals
File "/usr/lib/python2.6/site-packages/celery/__main__.py", line 54, in <module>
main()
File "/usr/lib/python2.6/site-packages/celery/__main__.py", line 30, in main
main()
File "/usr/lib/python2.6/site-packages/celery/bin/celery.py", line 81, in main
cmd.execute_from_commandline(argv)
File "/usr/lib/python2.6/site-packages/celery/bin/celery.py", line 769, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv)))
File "/usr/lib/python2.6/site-packages/celery/bin/base.py", line 305, in execute_from_commandline
argv = self.setup_app_from_commandline(argv)
File "/usr/lib/python2.6/site-packages/celery/bin/base.py", line 465, in setup_app_from_commandline
self.app = self.find_app(app)
File "/usr/lib/python2.6/site-packages/celery/bin/base.py", line 485, in find_app
return find_app(app, symbol_by_name=self.symbol_by_name)
File "/usr/lib/python2.6/site-packages/celery/app/utils.py", line 248, in find_app
symbol_by_name=symbol_by_name, imp=imp,
File "/usr/lib/python2.6/site-packages/celery/app/utils.py", line 232, in find_app
sym = imp(app)
File "/usr/lib/python2.6/site-packages/celery/utils/imports.py", line 101, in import_from_cwd
return imp(module, package=package)
File "/usr/lib64/python2.6/contextlib.py", line 34, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.6/site-packages/celery/utils/imports.py", line 64, in cwd_in_path
yield cwd
File "/usr/lib/python2.6/site-packages/celery/utils/imports.py", line 101, in import_from_cwd
return imp(module, package=package)
File "/usr/lib/python2.6/site-packages/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named celery
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'
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