- changed status to closed
celery use sqlalchemy is error
Issue #3395
closed
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/celery/app/trace.py", line 283, in trace_task
uuid, retval, SUCCESS, request=task_request,
File "/usr/local/lib/python2.7/site-packages/celery/backends/base.py", line 256, in store_result
request=request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/celery/backends/database/__init__.py", line 63, in _inner
return fun(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/celery/backends/database/__init__.py", line 118, in _store_result
session = self.ResultSession()
File "/usr/local/lib/python2.7/site-packages/celery/backends/database/__init__.py", line 111, in ResultSession
**self.engine_options
File "/usr/local/lib/python2.7/site-packages/celery/backends/database/session.py", line 60, in session_factory
engine, session = self.create_session(dburi, **kwargs)
File "/usr/local/lib/python2.7/site-packages/celery/backends/database/session.py", line 46, in create_session
engine = self.get_engine(dburi, **kwargs)
File "/usr/local/lib/python2.7/site-packages/celery/backends/database/session.py", line 43, in get_engine
return create_engine(dburi, **kwargs)
File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/__init__.py", line 386, in create_engine
return strategy.create(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 74, in create
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/usr/local/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 92, in dbapi
return __import__('MySQLdb')
ImportError: No module named MySQLdb
i sure my python install MySQL-python and i in python shell can import MySQLdb
Comments (3)
-
repo owner -
reporter Python 2.7.9 (default, Apr 20 2015, 17:09:28) [GCC 4.1.2 20080704 (Red Hat 4.1.2-55)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> print sys.path ['', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages'] >>> __import__('MySQLdb') <module 'MySQLdb' from '/usr/local/lib/python2.7/site-packages/MySQLdb/__init__.pyc'> >>>
-
repo owner from within the celery job that is failing. Otherwise what do you think SQLAlchemy is doing to make your
__import__
fail? - Log in to comment
this doesn't look anything like a SQLAlchemy issue, the call to
__import__()
is straightforward and if it isn't locating MySQLdb, then there is something wrong in your environment. try using pdb.set_trace(), then within that space, take a look at sys.path. Perhaps you're using a virtual environment of some kind or Celery is doing something.in any case there's no information here for me to attempt to fix your issue.