【问题标题】:CherryPy server stopped when i run my Turbogear application当我运行我的 Turbogear 应用程序时,CherryPy 服务器停止了
【发布时间】:2012-06-18 23:26:18
【问题描述】:

当我运行我的应用程序时,它会停止并报告以下错误:

 2012-06-16 02:40:51,767 turbogears.startup INFO Binding metadata for SQLAlchemy...
 2012-06-16 02:40:51,785 cherrypy.error ERROR [16/Jun/2012:02:40:51] ENGINE Error in 'start' listener <function start_turbogears at 0x02CE2BF0>
 Traceback (most recent call last):
   File "C:\Python27\lib\site-packages\cherrypy-3.2.2-py2.7-win32.egg\cherrypy\process\wspbus.py", line 197, in publish
     output.append(listener(*args, **kwargs))
   File "C:\Python27\lib\site-packages\turbogears-1.5.1-py2.7.egg\turbogears\startup.py", line 201, in start_turbogears
     database.bind_metadata()
   File "C:\Python27\lib\site-packages\turbogears-1.5.1-py2.7.egg\turbogears\database.py", line 80, in bind_metadata
     metadata.bind = sqlalchemy.create_engine(dburi, **alch_args)
   File "C:\Python27\lib\site-packages\sqlalchemy-0.4.4-py2.7.egg\sqlalchemy\engine\__init__.py", line 160, in create_engine
     return strategy.create(*args, **kwargs)
   File "C:\Python27\lib\site-packages\sqlalchemy-0.4.4-py2.7.egg\sqlalchemy\engine\strategies.py", line 62, in create
     dbapi = dialect_cls.dbapi(**dbapi_args)
   File "C:\Python27\lib\site-packages\sqlalchemy-0.4.4-py2.7.egg\sqlalchemy\databases\mysql.py", line 1420, in dbapi
     import MySQLdb as mysql
   File "C:\Python27\lib\site-packages\mysql_python-1.2.2-py2.5-win32.egg\MySQLdb\__init__.py", line 19, in <module>
     import _mysql
   File "C:\Python27\lib\site-packages\mysql_python-1.2.2-py2.5-win32.egg\_mysql.py", line 7, in <module>
   File "C:\Python27\lib\site-packages\mysql_python-1.2.2-py2.5-win32.egg\_mysql.py", line 6, in __bootstrap__
 ImportError: DLL load failed: The specified module could not be found.

 2012-06-16 02:40:51,845 cherrypy.error INFO [16/Jun/2012:02:40:51] ENGINE Started monitor thread 'Autoreloader'.
 2012-06-16 02:40:51,854 cherrypy.error INFO [16/Jun/2012:02:40:51] ENGINE Started monitor thread '_TimeoutMonitor'.
 2012-06-16 02:40:52,118 cherrypy.error INFO [16/Jun/2012:02:40:52] ENGINE Serving on 127.0.0.1:8087
 2012-06-16 02:40:52,127 cherrypy.error ERROR [16/Jun/2012:02:40:52] ENGINE Shutting down due to error in start listener:
 Traceback (most recent call last):
   File "C:\Python27\lib\site-packages\cherrypy-3.2.2-py2.7-win32.egg\cherrypy\process\wspbus.py", line 235, in start
     self.publish('start')
   File "C:\Python27\lib\site-packages\cherrypy-3.2.2-py2.7-win32.egg\cherrypy\process\wspbus.py", line 215, in publish
     raise exc
 ChannelFailures: ImportError('DLL load failed: The specified module could not be found.',)

 2012-06-16 02:40:52,161 cherrypy.error INFO [16/Jun/2012:02:40:52] ENGINE Bus STOPPING
 2012-06-16 02:40:52,270 cherrypy.error INFO [16/Jun/2012:02:40:52] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 8087)) shut down
 2012-06-16 02:40:52,285 cherrypy.error INFO [16/Jun/2012:02:40:52] ENGINE Stopped thread '_TimeoutMonitor'.
 2012-06-16 02:40:52,296 turbogears.startup INFO TurboGears has already been stopped.
 2012-06-16 02:40:52,301 cherrypy.error INFO [16/Jun/2012:02:40:52] ENGINE Stopped thread 'Autoreloader'.
 2012-06-16 02:40:52,308 cherrypy.error INFO [16/Jun/2012:02:40:52] ENGINE Bus STOPPED
 2012-06-16 02:40:52,312 cherrypy.error INFO [16/Jun/2012:02:40:52] ENGINE Bus EXITING
 2012-06-16 02:40:52,318 cherrypy.error INFO [16/Jun/2012:02:40:52] ENGINE Bus EXITED

 System information:
 OS: Windows 7, Python 2.7, Turbogears: 1.5.1, 
 dev.cfg: sqlalchemy.dburi = 'mysql://root:mysql@localhost:3306/VistaDB'

什么可能导致这个错误?

【问题讨论】:

    标签: python turbogears


    【解决方案1】:

    错误信息是“DLL 加载失败:找不到指定的模块。”

    这是一个mysql安装问题

    【讨论】:

    • 我已经创建了数据库并在 MySql 数据库中手动插入了一些记录。一旦我在 dev.cfg 文件中指定了 sqlalchemy.dburi 参数,我就无法启动我的应用程序。请指导我。
    • 谢谢大家,我刚刚添加了easy_install mysql-python和mysql-python-1.2.3.win64-py2.7.exe。一切正常。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-23
    • 1970-01-01
    相关资源
    最近更新 更多