装了Mysqldb,但是抛错
sechacking opened this issue · comments
这个错误是芹菜系统抛出的。
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
在服务器上进入python shell
import Mysqldb 不会显示说没这个东西?什么原因?
好奇怪的原因,sudo试试,或者用virtualenv重建个环境
python-mysql 库没安装成功