gpt4 book ai didi

Python:SQLAlchemy ImportError:没有名为 pysqlite2 的模块

转载 作者:行者123 更新时间:2023-12-02 12:48:45 25 4
gpt4 key购买 nike

我正在运行 python 2.7.3,因为我没有 root 访问权限,所以我手动将其安装在我的主目录中。系统上安装了2.6.6,但我确实需要2.7。当我运行该应用程序时,SQLAlchemy 抛出此 ImportError。所以我知道 2.7 中的 pysqlite2 现在是 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

最佳答案

对于可能遇到类似问题的其他人:What are sqlite development headers and how to install them?

关于Python:SQLAlchemy ImportError:没有名为 pysqlite2 的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14281825/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com