为什么启动时web2py会崩溃?

时间:2012-01-13 22:12:40

标签: python web2py

我试图在Ubuntu机器上运行web2py。所有文档似乎都表明要在* nix系统上运行它,你下载源代码并执行:

python web2py.py

我抓住了source(稳定来源,而不是主干,版本1.99.4)并尝试了上述内容,但输入了服务器的密码后我(在终端中):

$ python web2py.py 
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2011
Version 1.99.4 (2011-12-14 14:46:14) stable
Database drivers available: google
Starting hardcron...
WARNING:web2py.cron:WEB2PY CRON: Disabled because no file locking
please visit:
    http://127.0.0.1:8000
starting browser...
failed to create drawable
DEBUG: connect attempt 0, connection error:
Traceback (most recent call last):
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 4736, in __init__
    self._adapter = ADAPTERS[self._dbname](*args)
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 1634, in __init__
    raise RuntimeError, "Unable to import driver"
RuntimeError: Unable to import driver
WARNING:web2py.cron:WEB2PY CRON: Disabled because no file locking
DEBUG: connect attempt 1, connection error:
Traceback (most recent call last):
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 4736, in __init__
    self._adapter = ADAPTERS[self._dbname](*args)
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 1634, in __init__
    raise RuntimeError, "Unable to import driver"
RuntimeError: Unable to import driver
DEBUG: connect attempt 2, connection error:
Traceback (most recent call last):
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 4736, in __init__
    self._adapter = ADAPTERS[self._dbname](*args)
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 1634, in __init__
    raise RuntimeError, "Unable to import driver"
RuntimeError: Unable to import driver
DEBUG: connect attempt 3, connection error:
Traceback (most recent call last):
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 4736, in __init__
    self._adapter = ADAPTERS[self._dbname](*args)
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 1634, in __init__
    raise RuntimeError, "Unable to import driver"
RuntimeError: Unable to import driver
DEBUG: connect attempt 4, connection error:
Traceback (most recent call last):
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 4736, in __init__
    self._adapter = ADAPTERS[self._dbname](*args)
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 1634, in __init__
    raise RuntimeError, "Unable to import driver"
RuntimeError: Unable to import driver

然后在浏览器中我得到:

Internal error
Ticket issued: welcome/127.0.0.1.2012-.....[abbreviated]

有什么建议吗?我正在运行Python 2.7.1+。我在其他地方读到你还需要为web2py安装pyschopg2才能运行,我已经确认这实际安装了(我做了sudo apt-get install python-psycopg2并得到了“python-psycopg2已经是最新版本”了)。

2 个答案:

答案 0 :(得分:0)

我刚下载并且web2py在ubuntu,python 2.7.2 +

中运行正常

bruce @ vaiubuntu:〜/ Downloads / web2py $ python web2py.py

web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2011
Version 1.99.4 (2011-12-14 14:46:14) stable
Database drivers available: SQLite3, pymysql, PostgreSQL
Starting hardcron...

您是否尝试在appengine环境中运行web2py?

你的Python中SQLITE模块是否正常工作?

可能是权限问题,您的用户是否有权写入web2py / *文件夹?

答案 1 :(得分:0)

它看起来像web2py 1.99.4中的错误。使用Postgres和psycopg2我遇到了同样的问题,但是在Windows中。

我尝试使用1.99.2并且工作正常。

实际上,这个bug似乎与神秘的错误消息有关 - 1.99.2给了我一个错误信息,即数据库不存在,这很容易修复。 1.99.4没有提到丢失的数据库。但是,当我创建数据库并尝试使用1.99.4时,它工作正常。