Python 在Linux上启动新安装的web2py时出现异常
在Linux Redhat 64位(Python 2.7.3)上解压缩web2py最新源代码后,我启动服务器,第一个调用生成以下堆栈跟踪:Python 在Linux上启动新安装的web2py时出现异常,python,linux,web2py,redhat,Python,Linux,Web2py,Redhat,在Linux Redhat 64位(Python 2.7.3)上解压缩web2py最新源代码后,我启动服务器,第一个调用生成以下堆栈跟踪: test@test:~/web2py> python web2py.py --ip xxx.xxx.xxx.xxx web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2012 Version 2.2.1 (2012-10-21 16:57:04) stable Datab
test@test:~/web2py> python web2py.py --ip xxx.xxx.xxx.xxx
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2012
Version 2.2.1 (2012-10-21 16:57:04) stable
Database drivers available: MySQL(pymysql), PostgreSQL(pg8000), IMAP(imaplib)
WARNING:web2py:GUI not available because Tk library is not installed
choose a password:
please visit:
http://xxx.xxx.xxx.xxx:8000
use "kill -SIGTERM 4341" to shutdown the web2py server
DEBUG: connect attempt 0, connection error:
Traceback (most recent call last):
File "/home/aomoper/web2py/gluon/dal.py", line 6755, in __init__
self._adapter = ADAPTERS[self._dbname](**kwargs)
File "/home/aomoper/web2py/gluon/dal.py", line 2079, in __init__
if do_connect: self.find_driver(adapter_args)
File "/home/aomoper/web2py/gluon/dal.py", line 695, in find_driver
raise RuntimeError, "no driver available %s" % self.drivers
TypeError: not all arguments converted during string formatting
DEBUG: connect attempt 1, connection error:
Traceback (most recent call last):
File "/home/aomoper/web2py/gluon/dal.py", line 6755, in __init__
self._adapter = ADAPTERS[self._dbname](**kwargs)
File "/home/aomoper/web2py/gluon/dal.py", line 2079, in __init__
if do_connect: self.find_driver(adapter_args)
File "/home/aomoper/web2py/gluon/dal.py", line 695, in find_driver
raise RuntimeError, "no driver available %s" % self.drivers
TypeError: not all arguments converted during string formatting
DEBUG: connect attempt 2, connection error:
Traceback (most recent call last):
File "/home/aomoper/web2py/gluon/dal.py", line 6755, in __init__
self._adapter = ADAPTERS[self._dbname](**kwargs)
File "/home/aomoper/web2py/gluon/dal.py", line 2079, in __init__
if do_connect: self.find_driver(adapter_args)
File "/home/aomoper/web2py/gluon/dal.py", line 695, in find_driver
raise RuntimeError, "no driver available %s" % self.drivers
TypeError: not all arguments converted during string formatting
DEBUG: connect attempt 3, connection error:
Traceback (most recent call last):
File "/home/aomoper/web2py/gluon/dal.py", line 6755, in __init__
self._adapter = ADAPTERS[self._dbname](**kwargs)
File "/home/aomoper/web2py/gluon/dal.py", line 2079, in __init__
if do_connect: self.find_driver(adapter_args)
File "/home/aomoper/web2py/gluon/dal.py", line 695, in find_driver
raise RuntimeError, "no driver available %s" % self.drivers
TypeError: not all arguments converted during string formatting
DEBUG: connect attempt 4, connection error:
Traceback (most recent call last):
File "/home/aomoper/web2py/gluon/dal.py", line 6755, in __init__
self._adapter = ADAPTERS[self._dbname](**kwargs)
File "/home/aomoper/web2py/gluon/dal.py", line 2079, in __init__
if do_connect: self.find_driver(adapter_args)
File "/home/aomoper/web2py/gluon/dal.py", line 695, in find_driver
raise RuntimeError, "no driver available %s" % self.drivers
TypeError: not all arguments converted during string formatting
Anyone can help please?
Thanks
这个问题与Python安装中缺少sqlite3有关
使用该库重新编译Python修复了问题。在此学习如何格式化代码(将异常格式化为代码)。我们可能还需要一些代码。是的,在第三次尝试时这样做了:)我没有代码要显示,这是web2py开箱即用。可能重复:。我似乎觉得它找不到安装的任何数据库驱动程序包。您计划使用哪个数据库后端?SQLite至少应该是可用的(Python标准库附带)。另请参阅:。我知道这个问题,但它没有回答我的问题。。。现在我正在调查,因为在我的python安装中(我没有这样做),sqlite3似乎丢失了(导入sqlite3会给出一个异常)。python安装没有
sqlite3
包的事实确实是异常的,这可以解释错误。在我的Ubuntu安装中,它肯定是基本python-2.7
包的一部分。