2

我正在运行我手动安装在我的主目录中的 python 2.7.3,因为我没有 root 访问权限。系统上安装了2.6.6,但我确实需要2.7。当我运行应用程序时,SQLAlchemy 会抛出此 ImportError。所以我知道 pysqlite2 现在是 2.7 中的 sqlite3,所以我猜它对安装了哪个版本的 python 感到困惑。

这是一个回溯:

[11/Jan/2013:16:04:57] ENGINE Listening for SIGHUP.
[11/Jan/2013:16:04:57] ENGINE Listening for SIGTERM.
[11/Jan/2013:16:04:57] ENGINE Listening for SIGUSR1.
[11/Jan/2013:16:04:57] ENGINE Bus STARTING
[11/Jan/2013:16:04:57] ENGINE Starting up DB access
[11/Jan/2013:16:04:57] ENGINE Error in 'start' listener <bound method SAEnginePlugin.start of <giraffe.sa.saplugin.SAEnginePlugin object at 0x239c6d0>>
Traceback (most recent call last):
  File "/assetuser/lib/python2.7/site-packages/CherryPy-3.2.2-py2.7.egg/cherrypy/process/wspbus.py", line 197, in publish
    output.append(listener(*args, **kwargs))
  File "/assetuser/giraffe_server/giraffe/sa/saplugin.py", line 35, in start
    self.sa_engine = create_engine('sqlite:///giraffe.db', echo=False)
  File "/assetuser/lib/python2.7/site-packages/sqlalchemy/engine/__init__.py", line 338, in create_engine
    return strategy.create(*args, **kwargs)
  File "/assetuser/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 64, in create
    dbapi = dialect_cls.dbapi(**dbapi_args)
  File "/assetuser/lib/python2.7/site-packages/sqlalchemy/dialects/sqlite/pysqlite.py", line 286, in dbapi
    raise e
ImportError: No module named pysqlite2

CherryPy Checker:
dir is an absolute path, even though a root is provided.
section: [/Project]
root: '/assetuser/giraffe_server/static'
dir: '/assetuser/Project'

[11/Jan/2013:16:04:57] ENGINE Started monitor thread 'Autoreloader'.
[11/Jan/2013:16:04:57] ENGINE Started monitor thread '_TimeoutMonitor'.
[11/Jan/2013:16:04:57] ENGINE Serving on 0.0.0.0:8080
[11/Jan/2013:16:04:57] ENGINE Shutting down due to error in start listener:
Traceback (most recent call last):
  File "/assetuser/lib/python2.7/site-packages/CherryPy-3.2.2-py2.7.egg/cherrypy/process/wspbus.py", line 235, in start
    self.publish('start')
  File "/assetuser/lib/python2.7/site-packages/CherryPy-3.2.2-py2.7.egg/cherrypy/process/wspbus.py", line 215, in publish
    raise exc
ChannelFailures: ImportError('No module named pysqlite2',)

[11/Jan/2013:16:04:57] ENGINE Bus STOPPING
[11/Jan/2013:16:04:57] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down
[11/Jan/2013:16:04:57] ENGINE Stopped thread 'Autoreloader'.
[11/Jan/2013:16:04:57] ENGINE Stopped thread '_TimeoutMonitor'.
[11/Jan/2013:16:04:57] ENGINE Shutting down DB access
[11/Jan/2013:16:04:57] ENGINE Bus STOPPED
[11/Jan/2013:16:04:57] ENGINE Bus EXITING
[11/Jan/2013:16:04:57] ENGINE Bus EXITED
4

1 回答 1

2

对于可能有类似问题的其他人:什么是 sqlite 开发标头以及如何安装它们?

于 2013-10-29T09:27:32.227 回答